Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
An easy problem for you,propably
조회 수: 1 (최근 30일)
이전 댓글 표시
clc;
clear;
clear all;
temp= inputdlg('Ortam Sıcaklığını giriniz(Celcius)');
temp=str2double(temp)
if temp>=33
yazi=sprintf('T=%g(C)...Hava Aşırı SICAK...',temp)
elseif 33>temp>=24
yazi=sprintf('T=%g(C)...Hava Sıcak...',temp)
elseif 15<=temp<24
yazi=sprintf('T=%g(C)...Hava ILIK...',temp)
elseif 0<=temp<15
yazi=sprintf('T=%g(C)...Hava Soğuk...',temp)
else
yazi=sprintf('T=%g(C)...Hava Aşırı Soğuk...',temp)
end
msgbox(yazi)
I am trying to learn the program but i could not solve the problem.Don't stuck to the language its turkish.
My aim is if temp=>33 program should display a msgbox message that says The Air is so hot or sth and it should change in conditions
댓글 수: 0
답변 (1개)
Rik
2019년 5월 2일
Matlab doesn't work with double conditions, so you need to use a setup like the one below if you want to keep your code structure.
temp= inputdlg('Ortam Sıcaklığını giriniz(Celcius)');
temp=str2double(temp)
if temp>=33
yazi=sprintf('T=%g(C)...Hava Aşırı SICAK...',temp)
elseif 33>temp && temp>=24
yazi=sprintf('T=%g(C)...Hava Sıcak...',temp)
elseif 15<=temp && temp<24
yazi=sprintf('T=%g(C)...Hava ILIK...',temp)
elseif 0<=temp && temp<15
yazi=sprintf('T=%g(C)...Hava Soğuk...',temp)
else
yazi=sprintf('T=%g(C)...Hava Aşırı Soğuk...',temp)
end
msgbox(yazi)
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!