%% Convert Movie Frame to Image Data
% Create a surface plot.

% Copyright 2015 The MathWorks, Inc.


surf(peaks)     

%% 
% Use |getframe| to capture the plot as a movie frame.
% Then, convert the captured movie frame to image data.

F = getframe;              
[X,map] = frame2im(F); 

