MATLAB: How to store value of az and El in a variable

azimuthelevationrotate3dvariable

Hello all , as we know we use "rotate3d" function for rotating 3d objects , this shows Azimuth and Elevation angle , how to store those values into a variable so that we can access them after rotation also . the code is –
load mri.mat;
K = squeeze(D);
K = padarray(K,[10 10 10],'both');
% Create an isosurface
Ds = smooth3(K);
i_surface = isosurface(Ds,5);
% Display the surface
hiso = patch('Vertices', i_surface.vertices,...
'Faces', i_surface.faces,...
'FaceColor', [.2,.8,.9],...
'EdgeColor', 'none');
grid on;
view(90,90)
axis tight
daspect([1,1,.35])
h = rotate3d;
h.RotateStyle = 'box';
h.Enable = 'on';
lightangle(40,30);
set(gcf,'Renderer','zbuffer'); lighting phong
isonormals(Ds,hiso)
set(hiso, 'SpecularColorReflectance', 0, 'SpecularExponent', 50)

Best Answer

You didn’t post your code, so taking a wild guess, use the view function.
From its documentation:
  • [az,el] = view returns the current azimuth and elevation.