Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

An easy problem for you,propably

1 visualización (últimos 30 días)
Berke Kadir Türker
Berke Kadir Türker el 2 de Mayo de 2019
Cerrada: MATLAB Answer Bot el 20 de Ag. de 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

Respuestas (1)

Rik
Rik el 2 de Mayo de 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)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by