Effacer les filtres
Effacer les filtres

Movies on OS X

5 vues (au cours des 30 derniers jours)
Naveen
Naveen le 12 Juil 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)

Réponses (0)

Catégories

En savoir plus sur Animation dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by