Azzera filtri
Azzera filtri

plot when a value of zero makes issue

2 visualizzazioni (ultimi 30 giorni)
H-M
H-M il 27 Ago 2020
Modificato: H-M il 28 Ago 2020
my code below is supposed to plot different graph with different value of t:
many thanks
c=2;
nu = 1*1e-6;
r = linspace(0,100);
t=[1/2 1 2 6 10 20 50 ];
for count=1:7
v = c * (1-exp(-r.^2./(4*nu*t(count))))./r;
plot(r,v,'o-')
legend([' t= ',num2str(t(count))])
legend show
ylabel('v(m/sec)')
xlabel('r(m)')
grid on
hold on
end

Risposta accettata

David Hill
David Hill il 27 Ago 2020
If you change your nu to something more reasonable, it provides the graphs dynamics you are looking for.
nu=10;
  4 Commenti
David Hill
David Hill il 28 Ago 2020
No reason to execute hold commend multiple times in the loop. Once is enough.
H-M
H-M il 28 Ago 2020
Thank you so much David

Accedi per commentare.

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by