필터 지우기
필터 지우기

how could i animate this?

조회 수: 1 (최근 30일)
HADIMARGO
HADIMARGO 2018년 12월 17일
댓글: madhan ravi 2018년 12월 18일
x=linspace(-5,5,1000);
a_n=2;
b_n=3;
l=10;
for n=1:1:10
for t=0:1:10
y=a_n*cos((n*pi*t)/l)+b_n*sin((n*pi*t)/l)*sin((n*pi*x)/l);
end
end
u=y;
plot(x,u)
  댓글 수: 3
HADIMARGO
HADIMARGO 2018년 12월 17일
that is right!
madhan ravi
madhan ravi 2018년 12월 18일
you need to know that there are several curves created in each loop iteration but you overwrite all the values and only the end values are saved in the last iteration

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

채택된 답변

KSSV
KSSV 2018년 12월 18일
편집: KSSV 2018년 12월 18일
comet(x,u)
OR
x=linspace(-5,5,1000);
a_n=2;
b_n=3;
l=10;
for n=1:1:10
for t=0:1:10
y=a_n*cos((n*pi*t)/l)+b_n*sin((n*pi*t)/l)*sin((n*pi*x)/l);
plot(x,y)
pause(0.1)
end
end

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by