필터 지우기
필터 지우기

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
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개)

카테고리

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