How to code multiple "if" conditions in app designer?
Show older comments
I'm making a calculator app, that uses lots of variables, and one of these variables has a lot of conditions, so i'm trying to make something like
if tsd<=fyd
Sigma_sd=Es*epsilon_s;
elseif tsd>fyd&&Fck<=35&&Delta<=0.17&&fyk=50
Sigma_sd=43.48;
elseif tsd>fyd&Fck>35&&Delta<=0.17&&fyk=50
Sigma_sd=47.5;
elseif tsd>fyd&Fck<=35&&Delta<=0.17&&fyk=60
Sigma_sd=50
elseif tsd>fyd&Fck>35&&Delta<=0.17&&fyk=60
Sigma_sd=51
end
i also want to add more conditions to this code, for when Delta is higher then 0.17, and for delta higher than 0.20, so i think it would be something like this
elseif tsd>fyd&Fck>35&&0.17<delta<=0.2&&fyk=60
Sigma_sd=51;
elseif tsd>fyd&Fck>35&&Delta>0.20&&fyk=60
Sigma_sd=51;
i'm not asking for anyone to make my code, but just to help me to make a coded mult conditions such as my example above.
thanks for any help.
Answers (1)
if a < b < c
does not work.
You have to split the condition in two:
if a < b & b < c
And
if a = b
does not work.
A logical comparison for equality would be
if a == b
But checking for equality usually does not work because of floating-point arithmetic.
1 Comment
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!