Error in outputting a variable from function
Info
This question is closed. Reopen it to edit or answer.
Show older comments
Have a problem in trying to graph the outputs of my height function in my main file.
Answers (1)
James Tursa
on 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 Comment
Alexander Donaldson
on 24 Feb 2018
Edited: Alexander Donaldson
on 24 Feb 2018
This question is closed.
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!