how to use if option

4 ビュー (過去 30 日間)
surawut.A
surawut.A 2021 年 9 月 16 日
回答済み: Cris LaPierre 2021 年 9 月 16 日
Cs=[0.15:0.15:0.45];
Cx=0.12;
C0= 0;
%Erf=(Cs-Cx)/(Cs-C0);
Erf=[0.2 0.6 0.7333]
if Erf > 0 && Erf <=2
z=(-0.3725*(Erf^2))+(1.2144*(Erf))+(0.0006)
else if Erf >2
z=(-0.0109*((Erf)^2))+(0.0577*(Erf))+(0.9235)
end
%Erf formula above pls help to make it calculate and get 3 answer, i try many time still got only 0.6571 only 1 answer (Cs = 0.15 0.30 0.45)
and about if option
I want to use answer from above and let them choose formula, condition if ans<2 use first z formula, if ans>2 use second formula
I cant run with my code please help!
first formula z = -0.3725x^2+ 1.2144x + 0.0006
second z = -0.0109x^2 + 0.0577x + 0.9235

採用された回答

Cris LaPierre
Cris LaPierre 2021 年 9 月 16 日
See Ch 13 (Programming) of MATLAB Onramp

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeArgument Definitions についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by