What is the error in the following code? [code]for i={1: 10} p=a+1 end[/code]

What is the error in the following code?
Code:
for i={1: 10}
p=a+1
end
A. None
B. {}
C. The : operator
D. Cannot be determined
 
Answer: a
Explanation: MATLAB won’t give any error. but the loop will only run once because we have a syntactical error while defining the conditions for the loop.
 

Tìm kiếm

Back
Top