movieexample.m

来自「matlab7.0这本书的源代码」· M 代码 · 共 13 行

M
13
字号
% movie making example: rotate a 3-D surface plot
[X,Y,Z]=peaks(50);         % create data
surfl(X,Y,Z)               % plot surface with lighting
axis([-3 3 -3 3 -10 10])   % fix axes so that scaling does not change
axis vis3d off             % fix axes for 3D and turn off axes ticks etc.
shading interp             % make it pretty with interpolated shading
colormap(copper)           % choose a good colormap for lighting
for i=1:15                 % rotate and capture each frame
   view(-37.5+15*(i-1),30) % change the viewpoint for this frame
   m(i)=getframe;          % add this figure to the frame structure
end
cla       % clear axis for movie
movie(m)  % play the movie

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?