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.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Akzeptierte Antwort
VBBV
am 3 Dez. 2022
This is standard syntax for if-else statements in matlab
if condtion
...
elseif condition
...
else
...
end
2 Kommentare
Weitere Antworten (1)
Walter Roberson
am 3 Dez. 2022
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 Kommentare
Siehe auch
Kategorien
Mehr zu Octave finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!