L Lê Như Ý New member Sep 19, 2021 #1 What is the output of the following code? Code: for ( i=1:10 ) if{i<3} break end end A. Syntactical Error B. Logical Error C. i=1 D. i=2
What is the output of the following code? Code: for ( i=1:10 ) if{i<3} break end end A. Syntactical Error B. Logical Error C. i=1 D. i=2
T thanhthao New member Sep 19, 2021 #2 Answer: a Explanation: There is a syntactical error in the above code while giving the condition for the if structure. Hence, this leads to an error in MATLAB. If the condition was given within parentheses, the output would’ve been option i=1. Upvote 0 Downvote
Answer: a Explanation: There is a syntactical error in the above code while giving the condition for the if structure. Hence, this leads to an error in MATLAB. If the condition was given within parentheses, the output would’ve been option i=1.