필터 지우기
필터 지우기

Problem with "view" to save the orientation of a plot and then use it for another

조회 수: 6 (최근 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?

채택된 답변

Jan
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.
  댓글 수: 1
Marcos Belmonte
Marcos Belmonte 2011년 11월 23일
Hi, thanks very much for answering. Yes, I thought maybe it was for my version.
I have solved it with:
[az,el]=view;
and then:
view(az,el)
Thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

rjarvinen
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.

Anton
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 CenterFile 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!

Translated by