太原做网站哪家好,开放平台建设,商标注册查询平台,淘客app定制开发我会说这是你正在绘制的大量积分导致经济放缓.一个选项是缩减采样..也可以使用较低级别的功能进行绘制(检查this related post以获得plot3 / scatter3 / line性能的比较).考虑以下针对速度优化的动画#xff1a;[X Y Z] sphere(64);X X(:); Y Y(:); Z Z(:);%# set-up figu…我会说这是你正在绘制的大量积分导致经济放缓.一个选项是缩减采样..也可以使用较低级别的功能进行绘制(检查this related post以获得plot3 / scatter3 / line性能的比较).考虑以下针对速度优化的动画[X Y Z] sphere(64);X X(:); Y Y(:); Z Z(:);%# set-up figurehFig figure(Backingstore,off, renderer,zbuffer);%# use lower-level function LINEline(0.50*[X,X], 0.50*[Y,Y], 0.50*[Z,Z], LineStyle,none, Marker,., MarkerSize,1, Color,r)line(0.75*[X,X], 0.75*[Y,Y], 0.75*[Z,Z], LineStyle,none, Marker,., MarkerSize,1, Color,g)line(1.00*[X,X], 1.00*[Y,Y], 1.00*[Z,Z], LineStyle,none, Marker,., MarkerSize,1, Color,b)view(3)%# freeze the aspect ratio to override stretch-to-fill behaviouraxis vis3d%# fix the axes limits manually%#set(gca, xlim,[-1 1], ylim,[-1 1], zlim,[-1 1])axis manual%# maybe even remove the tick labels%set(gca, xticklabel,[], yticklabel,[], zticklabel,[])%# animate (until figure is closed)while ishandle(hFig); camorbit(0.9,-0.1); drawnow; end编辑如果我理解正确,你要做的是录制一个截屏视频(使用第三方应用),同时手动旋转图形,但在你的情况下,这些手动旋转是“跳跃”.另一方面,在一个while循环中使用CAMORBIT / VIEW动画你的数字运行顺畅……我提出了另一种解决方案首先使用鼠标旋转图形,然后在每个步骤(方位角,仰角)上写下这些视图配置.然后,您可以在录制视频时使用VIEW功能重播它们,例如v [...]; %# matrix where each row specify Az/El of viewfor i1:size(v,1)view( v(i,:) )drawnowend缺点是您必须以小步骤使用鼠标按下/旋转/释放(ROTATE3D对象不会暴露鼠标移动事件)我写了一个简单的函数来帮助你完成这个过程.它加载保存的图形,启用3d旋转,并跟踪每一步的中间位置.完成后,按“完成”按钮返回视图列表…function v rotationDemo(figFileName)views []; %# list of views (Az,El)hFig hgload(figFileName); %# load the saved figureviews(1,:) get(gca,View); %# store initial view%# add a button, used to terminate the processhButton uicontrol(Style,pushbutton, Position,[400 1 80 20], ...String,Done?, Callback,buttonCallback);set(hFig, Toolbar,figure) %# restore toolbar%# start 3d rotation, and handle post-callback to record intermediate viewsh rotate3d(hFig); %# get rotation objectset(h, ActionPostCallback,rotateCallback)set(h, Enable,on) %# enable rotationmsgbox(Rotate the view step-by-step, rotate3d, warn, modal)uiwait(hFig) %# wait for user to click buttondelete(hButton) %# delete button on finishset(h, Enable,off) %# disable rotationv round(views); %# return the list of views%# callback functionsfunction rotateCallback(o,e)views(end1,:) get(e.Axes,View); %# add current view to listendfunction buttonCallback(o,e)uiresume(gcbf) %# uiresume(hFig)endend你可以调用上面的函数,然后重放动画v rotationDemo(smooth_rotation.fig);for i1:size(v,1)view(v(i,:))drawnowend我们可以通过简单的插值来平滑过渡v rotationDemo(smooth_rotation.fig);n size(v,1);nn linspace(1,n,100); %# use 100 stepsvv round( [interp1(v(:,1),nn) interp1(v(:,2),nn)] );for i1:size(vv,1)view(vv(i,:))DRAWNOW %# or PAUSE(..) to slow it downend作为旁注,我应该提到ROTATE3D和CAMORBIT有不同的效果. ROTATE3D更改当前轴的View属性,而CAMORBIT控制当前轴的CameraTarget / CameraPosition / CameraUpVector的相机属性.