Could anyone tell me why I am getting an error with "else" in my code. This is my first time using this software and I am very confused.
6 ビュー (過去 30 日間)
古いコメントを表示

0 件のコメント
採用された回答
VBBV
2022 年 12 月 3 日
This is standard syntax for if-else statements in matlab
if condtion
...
elseif condition
...
else
...
end
2 件のコメント
その他の回答 (1 件)
Walter Roberson
2022 年 12 月 3 日
That code is not MATLAB code. MATLAB codes not use "endif" or "endwhile" or "end else". Also, MATLAB uses == for the comparison operation, not =
It might possibly be Octave code. The purpose of Octave existing is to put Mathworks out of business, so you will need to look elsewhere if you want assistance with Octave.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Octave についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!