why am I getting parse error as soon as I start loop ?
显示 更早的评论
As soon as I type for, if etc. I get,
Parse error at <EOL>: usage might be invalid matlab syntax.
I get this error even if I do not write a single line of code.
3 个评论
Dyuman Joshi
2022-12-12
"I get this error even if I do not write a single line of code."
Did you try to run a script or function file?
Askic V
2022-12-12
loops such as "for" of "if" statements should be ended with a keyword "end".
Ashish Phadke
2022-12-12
回答(1 个)
Walter Roberson
2022-12-12
1 个投票
the expression for the condition of if or while must start on the same line, not the next line.
Comparisons are == not =
类别
在 帮助中心 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!