Invalid use of operator in for loop
古いコメントを表示
Why am i getting an error message for this?
(am i also correct in using the '||' to mean 'or'?)
theta0 = tand(v0y/v0x)
for theta0 > 90 || theta0 < 0
% where the '>' gives an error message
end
if i switch the positions of the 'theta0 <0' and 'theta0 > 90' then i will get an error for the '<'
(whichever comes first has the error message)
採用された回答
その他の回答 (1 件)
Paul
2020 年 12 月 22 日
You're geting the error because that's the wrong syntax for a for loop:
doc for
Having said that, it kind of looks like you really want an if statement:
doc if
カテゴリ
ヘルプ センター および File Exchange で MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!