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.
2 次查看(过去 30 天)
显示 更早的评论
采纳的回答
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!