www.gusucode.com > 《matlab图像处理与界面编程宝典》秦襄培 编著,每章的MATLAB源代码程序 > 第12章/代码12-8.txt
r = subplot(2,1,1) Z = peaks; surf(Z); axis tight % 设置轴的范围为数据范围。 set(gca,'nextplot','replacechildren'); s = subplot(2,1,2) Z = peaks; surf(Z); % 使用peaks函数生成数据,surf生成三维表面 axis tight % 设置轴的范围为数据范围。 set(gca,'nextplot','replacechildren'); % 录制电影 for j = 1:20 axes(r) surf(sin(2*pi*j/20)*Z,Z) axes(s) surf(sin(2*pi*(j+5)/20)*Z,Z) F(j) = getframe(gcf); pause(.0333) end % 播放电影;注意它与图形框匹配不佳: h2 = figure; movie(F,10) % 使用图形句柄使帧画面与图形窗口匹配: movie(h2,F,10)