Question
MATLAB: Plotting from calling a function Here is the code for the function... function heat(Tout) dxg = 0.003; dxa = 0.01; hi = 12; ho
MATLAB: Plotting from calling a function
Here is the code for the function...
function heat(Tout)
dxg = 0.003; dxa = 0.01; hi = 12; ho = 44; kg = 0.81; ka = 0.015;
A = [kg/dxg + ho -kg/dxg 0 0; kg/dxg -kg/dxg - ka/dxa ka/dxa 0; 0 ka/dxa -ka/dxa - kg/dxg kg/dxg; 0 0 kg/dxg -kg/dxg - hi]; b = [ho*Tout 0 0 -23*hi]'; T = A\b; end
... When you run this function with a variable, it returns 4 values. These values are temperatues T1, T2, T3, and T4. These 4 values come from the T=A\b matrix.
I need a plot for values of Tout between 25 and 45 in 100 evenly spaced points versus the 4 values T1, T2, T3, and T4.
Here is the actual question:
write Matlab code that produces a plot of all four temperatures versus Tout for 100 evenly spaced values of Tout ranging from 25 to 45 degrees Celsius. You should do this by calling heat.m repeatedly inside a for loop. It may be helpful to use the colon operator to add the output of heat.m into a large matrix every time through the for loop.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started