필터 지우기
필터 지우기

plot when a value of zero makes issue

조회 수: 2 (최근 30일)
H-M
H-M 2020년 8월 27일
편집: H-M 2020년 8월 28일
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

채택된 답변

David Hill
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
David Hill 2020년 8월 28일
No reason to execute hold commend multiple times in the loop. Once is enough.
H-M
H-M 2020년 8월 28일
Thank you so much David

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Legend에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by