if else elseif and other conditions

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 日

1 投票

Seems fine to me. Did you try?

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSimulink Report Generator についてさらに検索

質問済み:

AA
2015 年 2 月 24 日

回答済み:

2015 年 2 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by