if else elseif and other conditions

1 次查看(过去 30 天)
if a>b
do function x
elseif a<b
do function y
else
do function z
end
#
I want a matlab code that executes a function x when a>b and another function y when a<b. If neither of the cases occurs then it should execute function z. The question is above code with 'else' and 'elseif' correct if I want to reach the aforementioned aim.
thanks

采纳的回答

Jos (10584)
Jos (10584) 2015-2-24
Seems fine to me. Did you try?

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by