Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

An easy problem for you,propably

1 Ansicht (letzte 30 Tage)
Berke Kadir Türker
Berke Kadir Türker am 2 Mai 2019
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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

Antworten (1)

Rik
Rik am 2 Mai 2019
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)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by