필터 지우기
필터 지우기

how to plot animation graph

조회 수: 5 (최근 30일)
vijayasinthujan vijayaratnam
vijayasinthujan vijayaratnam 2013년 3월 6일
i need to produce a mode shape in animation for beam vibration
eg:- assume beam vibration is sin wave for mode 1
just give me any idea for script file

답변 (1개)

Masoud Ghanbari
Masoud Ghanbari 2013년 3월 17일
Hi Use These Commands As a Sample
clear all
kr=1*1;
ki=1*1;
phi=1*pi/4;
xmax=15;
xmin=-4;
delx= 0.1;
x=[0:delx:xmax];
x2=[xmin:delx:xmax];
framemax=248;
M=moviein(framemax);
set(gcf,'Position',[100 100 640 480]);
for n=1:framemax
E=exp(-0.3.*x.*ki).*cos(kr.*x-2*pi*n/framemax);
H=exp(-0.3.*x.*ki).*cos(kr.*x-2*pi*n/framemax+phi);
S=E.*H;
figure(1)
whitebg([1 1 1]);
plot(x,E,'r','LineWidth',5);
hold on
plot(x-round(100*H)/30,-H,'b','LineWidth',5);
plot(x,S,'g','LineWidth',3);
legend('E-field','H-field','Power Density')
plot(x2,0.3*x2,'k','LineWidth',3);
plot(0*x2,x2,'k','LineWidth',3);
hold off
axis([-4 10 -1.1 1.5])
title('Wave Propogation In Very Lossy Media','fontsize',18)
M(:,n)=getframe(gcf);
end
clf reset
set(gcf,'Position',[100 100 800 600])
axis off
movie(M,3,1)
close all
Hope It helped...

카테고리

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