MATLAB: For loop or if condition

for loopheatingif statementthermostat

Hi,
I solved system of differential equations that present temperature values in two rooms. Now, I want to apply thermostat control which is active if temperature drops below 18 or go above 20 degrees. Is this loop correct?
for i=1:t t(i)=84600; if(T(i)>=18 && T(i)<=20) go else stop end end
Or is better to use if statement?
Thanks in advance!

Best Answer

First of all, this is not a correctly asked question.
Put your code in a correct format and be of a more explanatory nature.
While you mention 'OR' in your question , the code contains '&&' which stands for "AND".