Input

조회 수: 2 (최근 30일)
Nasir Qazi
Nasir Qazi 2012년 3월 11일
I want to manually assigned a value to T like this
T = input('Enter the value');
Tc = 256
Question if the enter value T > Tc the error comes up and stop to program to move forward. How can I do that.

채택된 답변

Image Analyst
Image Analyst 2012년 3월 11일
T = input('Enter the value ')
Tc = 256
if T == Tc
msgbox('T = TC');
return; % or break or continue, depending on what you want...
else
msgbox('T not = Tc');
end
  댓글 수: 2
Nasir Qazi
Nasir Qazi 2012년 3월 11일
I don't want a msg to appear on want to execute the program if T < Tc otherwise stop the program
Image Analyst
Image Analyst 2012년 3월 11일
So take it out. You know you can adapt my demo code as you wish. If you don't want the msgbox, don't use it.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by