How make coding for condition in MATLAB

Line 19 how to write the code for conditioning for sqrt(1-((PA/Ps)^0.2856)
so that (PA/Ps)^0.2856 is equal to "a" and the condition "a" must be less than 1
if "a" is more than 1 the value of "a" is change to 0.1

 Accepted Answer

dpb
dpb on 30 Nov 2013
Edited: dpb on 1 Dec 2013
a=(PA/Ps)^0.2856;
if a>1, a=0.1; end
It would seem that's a pretty big discontinuity to introduce, however, by the choice of replacement value. You sure you don't want just
a=min(a,1);
which could be written as
a=min((PA/Ps)^0.2856,1.0);
Or, would it perhaps make more sense to move up in the logic and limit PA, maybe???

More Answers (0)

Asked:

on 30 Nov 2013

Edited:

dpb
on 1 Dec 2013

Community Treasure Hunt

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

Start Hunting!