Error in outputting a variable from function
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen
Have a problem in trying to graph the outputs of my height function in my main file.
Antworten (1)
James Tursa
am 23 Feb. 2018
Change your switch-case logic to if-then-else logic. E.g.,
switch h >= 0 && h <= 105
case h >= 0 && h < 11
:
case h >= 11 && h < 25
:
Would become this:
if h >= 0 && h < 11
:
elseif h >= 11 && h < 25
:
etc
:
else
error('Invalid height'); % catch invalid inputs here
end
1 Kommentar
Alexander Donaldson
am 24 Feb. 2018
Bearbeitet: Alexander Donaldson
am 24 Feb. 2018
Diese Frage ist geschlossen.
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!