Borrar filtros
Borrar filtros

if else elseif and other conditions

1 visualización (últimos 30 días)
AA
AA el 24 de Feb. de 2015
Respondida: Jos (10584) el 24 de Feb. de 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

Respuesta aceptada

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

Más respuestas (0)

Categorías

Más información sobre Multidimensional Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by