Azzera filtri
Azzera filtri

Movies on OS X

5 visualizzazioni (ultimi 30 giorni)
Naveen
Naveen il 12 Lug 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)

Risposte (0)

Categorie

Scopri di più su Animation in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by