No lines on my graph
1 view (last 30 days)
Show older comments
Yaneli Rubio
on 24 Oct 2020
Commented: Star Strider
on 27 Oct 2020
Hello,
I have gone through multiple of the post with similar problems without any luck. Can some one help? Why do no lines show on my graph?
% Assumened Values
Ti=20;
Tamb=38;
h=5.2;
d=1035; %density
c=3350;
k=0.62;
t=3600; %time in seconds
r=0.025; %radius
V=3/4*pi*r^3;
m=d*V
a= 2.3184*10^-5;
A=4*pi*r^2;
% for spherical system
Lc=r/3
%Biot Number
Bi= h*Lc/k
% Temperature after 60 minutes
T=Tamb+(exp((-h*A)/(m*c)*t)*(Ti-Tamb))
%plot T vs t
x=[0:100:3600]; %time on x-axis
plot(t,T), xlabel('time'), ylabel('Temperature'), title('Temperature vs Time')
0 Comments
Accepted Answer
Star Strider
on 24 Oct 2020
I suspect that ‘t’ is supposed to be a vector:
t=0:3600; %time in seconds
and then using element-wise division in the ‘T’ assignment:
T=Tamb+(exp((-h*A)./(m*c)*t)*(Ti-Tamb));
and the plotted ‘T’ as a function of ‘t’ curve magickally appears!
2 Comments
Star Strider
on 27 Oct 2020
As always, my pleasure!
No worries! I’ve done similar things and I’m certain others have as well!
More Answers (0)
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!