plot when a value of zero makes issue
2 ビュー (過去 30 日間)
古いコメントを表示
my code below is supposed to plot different graph with different value of t:
many thanks
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/352622/image.jpeg)
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
0 件のコメント
採用された回答
David Hill
2020 年 8 月 27 日
If you change your nu to something more reasonable, it provides the graphs dynamics you are looking for.
nu=10;
4 件のコメント
David Hill
2020 年 8 月 28 日
No reason to execute hold commend multiple times in the loop. Once is enough.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Legend についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!