Goal Using MATLAB Create a single script file to answer the
Goal: Using MATLAB Create a single script file to answer the following problems. Remember not to store any values in the default variable ans. Write introductory comments for each problem including the problem description, input, processing, and output immediately before each problem. Use the commands cle and clear at the beginning of your script file.
Solution
% % problem discription %%%%%%%%%%%%%%%%
% % Calculate the temperature of the can of soda form 0 to 3 hoyrs in
% % increatment of 0.1 hours.The change of temperature of an object placed
% % in anisothermal chamber may be modeled by formula
% % T = Ts +(To - Ts)ext(-kt), where T is temperature and t is time
clear;
clc;
%%%%%%%%%%% Input of given problem %%%%%%%%%%%%%%
k=0.40;
To=38; %%%%% initial temperature at t=0 %%%%%%%%%%%
Ts=125; %%%%%%% Isothermal environemnt temperature %%%%%%
%%%%%%% processing %%%
t=[0:0.1:3];
t=sort(t(:));
T = Ts +((To - Ts)*exp(-k*t));
T=sort(T(:));
%%% Output %%%%%
Reult=[T t]
Kindly provide the feedback. thank You
