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

 Réponse acceptée

dpb
dpb le 30 Nov 2013
Modifié(e) : dpb le 1 Déc 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???

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by