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

 採用された回答

dpb
dpb 2013 年 11 月 30 日
編集済み: dpb 2013 年 12 月 1 日

0 投票

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

その他の回答 (0 件)

カテゴリ

質問済み:

2013 年 11 月 30 日

編集済み:

dpb
2013 年 12 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by