No lines on my graph

1 vue (au cours des 30 derniers jours)
Yaneli Rubio
Yaneli Rubio le 24 Oct 2020
Commenté : Star Strider le 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')

Réponse acceptée

Star Strider
Star Strider le 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 commentaires
Yaneli Rubio
Yaneli Rubio le 27 Oct 2020
I can't believe I missed that. Thank you so much!
Star Strider
Star Strider le 27 Oct 2020
As always, my pleasure!
No worries! I’ve done similar things and I’m certain others have as well!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by