I wish to use an if-else flow block (or a custom matlab function that does it) in SIMULINK and use embedded coder to generate code for it. I had previously encountered a problem with zero and one-based indexing with MATLAB function blocks used in SIMULINK. It seems that there is practically no way around it. How can I model a if-elseif logic in SIMULINK then?
I have tried to use switch and mux blocks but they are too messy and could result into misinterpretation of original flow logic that I am trying to implement.
My flow logic (PSEUDOCODE) is:
if (a<b) then
p = x;
else if (a<c) then
p = max(y, some_const_val);
else
p = z;
Could someone please suggest a way?
KR,