Movies on OS X

4 次查看(过去 30 天)
Naveen
Naveen 2014-7-12
Hello Everyone,
I am trying to save a movie in Matlab. The figure display correctly however the movie file doesn't the figure window but it shows a part of figure window and part of the Matlab UI. I am using Matlab 2013a on OS X 10.9.4. I am pasting the code below. Please suggest why this is happening. I dock the figure window to the Matlab desktop by default.
clear;
close all;
% Creates a 2D Mesh to plot surface
x=linspace(0,1,100);
[X,Y] = meshgrid(x,x);
N=100; % Number of frames
set(gca,'nextplot','replacechildren');
set(gcf,'Renderer','zbuffer');
M(N) = struct('cdata',[],'colormap',[]);
for i = 1:N
% Example of plot
Z = sin(2*pi*(X-i/N)).*sin(2*pi*(Y-i/N));
surf(X,Y,Z)
% Store the frame
M(i)=getframe; % leaving gcf out crops the frame in the movie.
end
myVideo = VideoWriter('wavemotion.m4v', 'MPEG-4');
open(myVideo);
writeVideo(myVideo,M)
close(myVideo)

回答(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