And*_*kau 8 matlab plot smooth rotation
如果我尝试在我目前的数字与旋转摄像头plot3
使用
while true; camorbit(0.9,-0.1); drawnow; end
Run Code Online (Sandbox Code Playgroud)
然后即使在8核MacPro上,旋转也会定期挂起一段时间(例子).
我可以顺利吗?
EDIT1:
虽然我的原始问题还没有解决方案,但我已经成功制作了一部具有getframe
功能的更好的电影.但它不允许记录徒手旋转,并且在MATLAB2010b for Mac中非常错误.
%# fix wrong figure position in MATLAB2010b for Mac - depends on your layout
correctedPosition = get(gcf,'Position') + [21 -125 0 0];
fps = 60; sec = 10;
vidObj = VideoWriter('newfile.avi');
vidObj.Quality = 100;
vidObj.FrameRate = fps;
open(vidObj);
for i=1:fps*sec
camorbit(0.9,-0.1);
writeVideo(vidObj,getframe(gcf, correctedPosition));
end
close(vidObj);
Run Code Online (Sandbox Code Playgroud)
EDIT2:
我在MATLAB Central创建了一个类似的线程.
EDIT3:
您可以自己尝试下载我的一个数字.
我不知道这是否对您的问题有帮助,但出于某种原因,我pause(0.001)
比drawnow
强制更新图形窗口取得了更好的成功
您还可能会看到rotate3d 是否更快。
核心数量并不像你想象的那么重要,因为 matlab 中的许多函数不支持多线程。
解决方法是像现在一样继续,但将图形窗口写入电影文件。然后您就可以播放电影了。