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

 Akzeptierte Antwort

dpb
dpb am 30 Nov. 2013
Bearbeitet: dpb am 1 Dez. 2013

0 Stimmen

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???

Weitere Antworten (0)

Gefragt:

am 30 Nov. 2013

Bearbeitet:

dpb
am 1 Dez. 2013

Community Treasure Hunt

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

Start Hunting!

Translated by