Azzera filtri
Azzera filtri

if and if else command is the conditional statement is correct while writing it is range?

1 visualizzazione (ultimi 30 giorni)
if T==300:900 c1=1.6; c2=1.7; elseif T==991:1500 C1=1.8; c2=1.9; else C1=0; c2=0; end

Risposta accettata

Mischa Kim
Mischa Kim il 16 Set 2016
Modificato: Mischa Kim il 16 Set 2016
Anas,
if (T >= 300) && (T <= 900)
c1=1.6; c2=1.7;
elseif (T > 900) && (T <= 1500)
C1=1.8; c2=1.9;
else
C1=0; c2=0;
end
Also, variable names are case sensitive. In other words, c1 is not the same as C1.
  3 Commenti
Anas Rao
Anas Rao il 16 Set 2016
@Mischa Kim Thankyou. Your function works. I found mistake in my Program. Thanks a lot for your help.

Accedi per commentare.

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by