how to use if option

2 Ansichten (letzte 30 Tage)
surawut.A
surawut.A am 16 Sep. 2021
Beantwortet: Cris LaPierre am 16 Sep. 2021
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

Akzeptierte Antwort

Cris LaPierre
Cris LaPierre am 16 Sep. 2021
See Ch 13 (Programming) of MATLAB Onramp

Weitere Antworten (0)

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by