Save the quiver plot as a video

조회 수: 10 (최근 30일)
Karthik Brs
Karthik Brs 2015년 11월 30일
댓글: Karthik Brs 2015년 12월 1일
Hello, I am trying to save the quiver plot as a .avi movie. I am including my code here:
hFig = figure;
subplot(1,2,1);
set(hFig, 'Position', [0 0 1000 1000]); % to define Figure Properties
stlgeometrie=stlread('gehause_Bmuster.stl');
geoplot(stlgeometrie);
axis([-200 200 -200 200 -200 200]);
view([0 0]);
hold on;
subplot(1,2,2);
set(hFig, 'Position', [0 0 1000 1000]); % to define Figure Properties
stlgeometrie=stlread('gehause_Bmuster.stl');
geoplot(stlgeometrie);
axis([-200 200 -200 200 -200 200]);
view([60 0]);
hold on;
for e = 1:length(range);
a=0.1;
subplot(1,2,1);
q1 = quiver3(x,y,z, a*mag_X(21,:)'.*cos(Ph_X(21,:)'+range(e)), a*mag_Y(21,:)'.*cos(Ph_Y(21,:)'+range(e)), a*mag_Z(21,:)'.*cos(Ph_Z(21,:)'+range(e)),0,'MarkerSize',3,'LineWidth',1.5,'MaxHeadSize',0.1);
subplot(1,2,2);
q2 = quiver3(x,y,z, a*mag_X(21,:)'.*cos(Ph_X(21,:)'+range(e)), a*mag_Y(21,:)'.*cos(Ph_Y(21,:)'+range(e)), a*mag_Z(21,:)'.*cos(Ph_Z(21,:)'+range(e)),0,'MarkerSize',3,'LineWidth',1.5,'MaxHeadSize',0.1);
M{e} = getframe;
Fz(e) = mag_Z(100,1)'.*cos(Ph_Z(100,1)'+range(e));
delete(q1);
delete(q2);
end
movie(cell2mat(M));
movie2avi(cell2mat(M),'MyMovie.avi','Compression','None');
When I use the following code, I can only see the video of second sub-plot and the video doesn't contain the video, but just a image of the second sub-plot. I just want to save the video which gets displayed because of the quiver command. I am also attaching my workspace variables with this query! Thank you in advance!

답변 (1개)

Walter Roberson
Walter Roberson 2015년 11월 30일
M{e} = getframe(gcf);
Note: this will capture the entire figure, including window decorations. getframe() captures an axes or a figure, but you are creating multiple axes so you need to save the figure.
  댓글 수: 5
Walter Roberson
Walter Roberson 2015년 12월 1일
I think it is time for me to go to bed (in a literal sense.)
Karthik Brs
Karthik Brs 2015년 12월 1일
Would be glad if you could get back to me tomorrow! :)

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

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by