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 Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

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