Clear Filters
Clear Filters

if else elseif and other conditions

1 view (last 30 days)
AA
AA on 24 Feb 2015
Answered: Jos (10584) on 24 Feb 2015
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

Accepted Answer

Jos (10584)
Jos (10584) on 24 Feb 2015
Seems fine to me. Did you try?

More Answers (0)

Categories

Find more on Multidimensional Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!