Updated.
I have this code structure inside a loop. x, y and z are 1/0 variables. In this case the order of the elseif statement is: first x is evaluated, then y then z
if x
elseif y
elseif z
end
I would like to define a varible order (for the previous case order={'caseX','caseY','caseZ'}), where I can change the order in which the elseif statement is evaluated. So if I set order={'caseZ','caseX','caseY'}, I should get this: (first z is evaluated, then x then y)
order={'caseZ','caseX','caseY'}
if z
elseif x
elseif y
end
An hint will be appreciated.
2 Comments
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/696325-set-order-of-elseif#comment_1213100
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/696325-set-order-of-elseif#comment_1213100
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/696325-set-order-of-elseif#comment_1213605
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/696325-set-order-of-elseif#comment_1213605
Sign in to comment.