Azzera filtri
Azzera filtri

how to use if option

2 visualizzazioni (ultimi 30 giorni)
surawut.A
surawut.A il 16 Set 2021
Risposto: Cris LaPierre il 16 Set 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

Risposta accettata

Cris LaPierre
Cris LaPierre il 16 Set 2021
See Ch 13 (Programming) of MATLAB Onramp

Più risposte (0)

Categorie

Scopri di più su Argument Definitions in Help Center e File Exchange

Prodotti


Release

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by