Input

2 Ansichten (letzte 30 Tage)
Nasir Qazi
Nasir Qazi am 11 Mär. 2012
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.

Akzeptierte Antwort

Image Analyst
Image Analyst am 11 Mär. 2012
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 Kommentare
Nasir Qazi
Nasir Qazi am 11 Mär. 2012
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 am 11 Mär. 2012
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by