0% found this document useful (0 votes)
21 views

Matlab Check Temp

The document defines a MATLAB function that simulates the cooling of coffee over time. It takes initial temperature t0, cooling rate K, ideal drinking temperature range tHot to tCold as inputs. The function calculates temperature every 0.15 minutes from 0-300 minutes, and indicates for each time point whether the temperature is within the safe range to drink. The output is a 21x3 cell array with time, temperature, and drinkability recommendation for each time point.

Uploaded by

Jessica Aguilar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Matlab Check Temp

The document defines a MATLAB function that simulates the cooling of coffee over time. It takes initial temperature t0, cooling rate K, ideal drinking temperature range tHot to tCold as inputs. The function calculates temperature every 0.15 minutes from 0-300 minutes, and indicates for each time point whether the temperature is within the safe range to drink. The output is a 21x3 cell array with time, temperature, and drinkability recommendation for each time point.

Uploaded by

Jessica Aguilar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

t0=80;

K=.001;
tHot=70;
tCold=45;
q=coffee(t0,K,tHot,tCold)
function y1=coffee(t0,K,tHot,tCold)
y1={};
q=0:15:300;
q=num2cell(q');
y1(1:length(q),1)=q';
for i=1:length(q)
y1(i,2)={t0*(exp((-K*(cell2mat(y1(i))))))};
if(cell2mat(y1(i,2))>=tHot|cell2mat(y1(i,2))<=tCold)
y1(i,3)={'Dont drink'};
end
end
end

q =
213 cell array
[
[
[
[
[
[
[

PRO version

0]
15]
30]
45]
60]
75]
90]

[
80]
[78.8090]
[77.6356]
[76.4798]
[75.3412]
[74.2195]
[73.1145]

'Dont
'Dont
'Dont
'Dont
'Dont
'Dont
'Dont

drink'
drink'
drink'
drink'
drink'
drink'
drink'

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

[105]
[120]
[135]
[150]
[165]
[180]
[195]
[210]
[225]
[240]
[255]
[270]
[285]
[300]

[72.0260]
[70.9536]
[69.8973]
[68.8566]
[67.8315]
[66.8216]
[65.8268]
[64.8467]
[63.8813]
[62.9302]
[61.9933]
[61.0704]
[60.1611]
[59.2655]

'Dont drink'
'Dont drink'
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]

Published with MATLAB R2016b

PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

You might also like