Movies on OS X

4 visualizaciones (últimos 30 días)
Naveen
Naveen el 12 de Jul. de 2014
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)

Respuestas (0)

Categorías

Más información sobre Animation en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by