How do I control the Azimuth and Declination view angles of a 3D Plot?

2 visualizaciones (últimos 30 días)
Say I generate a GUI which has a 3d Plot/Surf in it. I want to know the best way to add user controls to manipulate the angle of view for the plot. Ie. the azimuth and declination.
I've had a look at axes properties, in order to try to get an understanding of the method in which MATLAB defines the view of a 3d plot. It seems to define a CameraPosition and "Up-Axis".
I was wondering if there's a quick and simple way to change the view without having to activate MATLAB's own 3DRotate within the figure?
Attached is some simple code below, which show's roughly what I'm on about. Ideally I'd like to create callback functions for the 2 sliders (s1 and s2) in order to alter the view accordingly.
%%QUICK EXAMPLE
%%Plot Data
a=rand(10); %Random Matrix
f=figure(); %Figure Window
s=surf(a); %Surface Plot
ax=gca; %Get Axis Handle
%%Add Sliders
s1=uicontrol('Style','Slider','Units','Normalized','Position',...
[0.05,0.05,0.3,0.05],'Tag','Azimuth','Min',-180,'Max',180,...
'Value',0);
s2=uicontrol('Style','Slider','Units','Normalized','Position',...
[0.65,0.05,0.3,0.05],'Tag','Declination','Min',-90,'Max',90,...
'Value',0);
Thanks,
Gav

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 24 de Oct. de 2012
I think you're trying to hard:

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by