Friday 18 April 2014

Wanna make video in Matlab? Learn to use VideoWriter command: bumping peaks


Run the following code on matlab and check the output Just modified for you for details see 'VideoWriter' % Prepare the new file. vidObj = VideoWriter('bummping_peaks.avi'); open(vidObj); % Create an animation. Z = peaks; surf(Z); axis tight set(gca,'nextplot','replacechildren'); for k = 1:2000 surf(sin(2*pi*k/20)*Z,Z) % Write each frame to the file. currFrame = getframe; writeVideo(vidObj,currFrame); end % Close the file. close(vidObj);