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

1 次查看(过去 30 天)
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

采纳的回答

Mischa Kim
Mischa Kim 2016-9-16
编辑:Mischa Kim 2016-9-16
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 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by