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

 採用された回答

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 件のコメント

Anas Rao
Anas Rao 2016 年 9 月 16 日
Operands to the and && operators must be convertible to logical scalar values.
Error in entrainment_model (line 208) if (300<=tt)&& (tt<=999)
This is giving this error? Can you Please guide me how I remove this error?
Mischa Kim
Mischa Kim 2016 年 9 月 16 日
I would need to see your entire code including input parameters. Can you attach?
Anas Rao
Anas Rao 2016 年 9 月 16 日
@Mischa Kim Thankyou. Your function works. I found mistake in my Program. Thanks a lot for your help.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeVariables についてさらに検索

タグ

質問済み:

2016 年 9 月 16 日

コメント済み:

2016 年 9 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by