Problem with "view" to save the orientation of a plot and then use it for another
2 次查看(过去 30 天)
显示 更早的评论
Hi, I'm trying to save the position of a plot in a subplot in order to plot the next with the same orientation (the code was performed already)
I tried with : orientation = view; % Its output is a 4 by 4 matrix. and then: view(orientation)
but I have an error in the second line I wrote: "Error using ==> view>ViewCore Argument must be scalar, or two-vector"
Could you help me, please?
0 个评论
采纳的回答
Jan
2011-11-22
In Matlab 2009a there was a 4x4 output and input for the view command:
view(T) sets the view according to the transformation matrix T,
which is a 4-by-4 matrix such as a perspective transformation
generated by viewmtx.
T = view returns the current 4-by-4 transformation matrix
In the documentation of the current release 2011b I do not find any hint about this feature anymore: doc view.
Of course the removing of this feature might be explained anywhere in the release notes or bugreports. But the best location for such changes and suggested workarounds would be the documentation.
更多回答(2 个)
rjarvinen
2012-3-5
Is there a way to store all camera settings in a variable and re-use them in several plots? Does the 4-by-4 matrix returned by the view function include all the camera and view information?
What I have done is to manually adjust the camera and view properties in the GUI for a single 3-D plot. Now I would like to save this configuration for easy later use to avoid doing this again for other similar plots.
view([az el]) is not enough since it does not include all the camera properties a user can adjust in the GUI.
0 个评论
Anton
2012-3-20
very stupid to take away this backward compatibility! I had a script where the 4-by-4 matrix was stored in a variable A and the figure rotated with view(A) - fortunately it was always the same matrix (constant) and I simply changed the line to view(-46,44) to have an appropriate 3D-like view of my figure.
A= 1.0e+04*[ 0.4496 -0.4782 0.0000 0.0143
0.3244 0.2981 0.0000 -0.3113
0.3587 0.3298 -0.0000 4.2989
0 0 0 0.0001];
May be there is a simple way to transform this 4x4 matrix to the two angles, but it is very strange that 16 values were used instead of 2 befor and that there is no way to use this matrix directly now (you can still generate it with A=view)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 MATLAB Support Package for USB Webcams 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!