Error in outputting a variable from function
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
Have a problem in trying to graph the outputs of my height function in my main file.
0 个评论
回答(1 个)
James Tursa
2018-2-23
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 个评论
Alexander Donaldson
2018-2-24
编辑:Alexander Donaldson
2018-2-24
此问题已关闭。
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!