重用Matlab中的视图输出矩阵 [英] Re-use the view output matrix in Matlab
问题描述
在Matlab中,我创建了一个相当复杂的3D图,然后手动操作视图选项,直到对所看到的内容感到满意(如下所示).如何重用最终视图的参数?我可以得到view
命令的输出,该命令是4 x 4矩阵,但是后者似乎不可重用?
In Matlab, I create a fairly complicated 3D plot, then manipulate the view option by hand up to a point where I am happy with what I see (below). How can I reuse the parameters of the final view? I can get the output of the view
command which is a 4 by 4 matrix, but the latter does not seem to be reusable?
推荐答案
好吧,基于Suever的评论,我意识到可以通过名为matlab.graphics.axis.Axes
的图形界面访问所需的所有图形属性.在这里可以找到摄像机的参数.另一种方法是如下找到它们:
ok, based on Suever's comments, I realized that all the figure properties I need can be accessed through the Graphical Interface called matlab.graphics.axis.Axes
. This is where the parameters of the camera can be found. Another approach is to find them one by one as follows:
get(gca,'Projection')
get(gca,'CameraPosition')
get(gca,'CameraViewAngle')
get(gca,'CameraTarget')
,然后直接在脚本中设置它们:
and then set them directly in the script:
set(gca,'Projection','perspective')
set(gca,'CameraPosition',[-7 -5 3]/15)
set(gca,'CameraViewAngle',85)
set(gca,'CameraTarget',[0 .5 0])
我本来以为view
命令将立即提供此信息.
I originally thought the view
command would provide this information at once.
这篇关于重用Matlab中的视图输出矩阵的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!