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

 Respuesta aceptada

dpb
dpb el 30 de Nov. de 2013
Editada: dpb el 1 de Dic. de 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???

Más respuestas (0)

Preguntada:

el 30 de Nov. de 2013

Editada:

dpb
el 1 de Dic. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by