How to view the entire 3D object in XY plane and access the values from it

I have 3 ellipsoids that I have created using the ellisoid function. I need to view the ellipsoid in XY and XZ axis and access the values of all the 3 ellipse for some other calculation. I am familar with the view function, but how could I access the values from it. Can somebody help / suggest how could I calulate it in matlab?
Thanks,

Answers (1)

Try rotate
[x,y,z] = ellipsoid();
h = surf(x,y,z);
rotate(h,angle,dir,origin)
z1 = get(h,'zdata');

8 Comments

I didn't get you clearly. If I use view(0,0) and view(0,90) I can get my whole surface in XY and XZ plane, But how can I access the data from view to calculate the major and minor axis of ellipse? is that possible?
Thanks
I dont'' understand. view() function doesn't return any data. I thought you want some after rotation. Isn't it?
Thanks for the message. What I was looking for is to view the ellipsoids in XY and XZ plane so as to get an ellipse and then find their major and minor axis. I hope the question is clear now.
Thanks,
No, it's not. I still don't understand. Are you asking how to manipulate using view() or what?
No its not I was just saying view as an example..
I was trying it out and could you tell me if this is right? Can I find the major/minor axis values of ellipse by using Maxis =max(x)-min(x); and max(y)-min(y)? if wrong, is there any way to find it?
e=[4.00e-04 -0.0015 -1.5000; %a,b,c values of ellipsoid
-7.00e-04 8.00e-04 0.6667];
ec=[71.0561 -129.2695 7.7346; %Ellipsoid centres
71.0576 -129.2728 1.3333];
function getEllXY(e,ec) %Get ellipsoid in XY plane (Ellipse)
f2=figure;
t=linspace(0,2*pi);
for k=1:numel(e(:,1))
x=e(k,1)*cos(t)+ec(k,1);
y=e(k,2)*sin(t)+ec(k,2);
plot(x,y,'r'); %Plot ellipse
hold on;
end
end
  • Can I find the major/minor axis values of ellipse by using Maxis =max(x)-min(x); and max(y)-min(y)? if wrong, is there any way to find it?
If the axes horizontal or vertical then answer is YES. But if the ellises will be rotated at some angle then answer is NO

Sign in to comment.

Asked:

on 17 Aug 2021

Commented:

on 19 Aug 2021

Community Treasure Hunt

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

Start Hunting!