how to plot ellipsoid?
22 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
ellipsoid equation is x^2 +y^2 +2z^2 =10
0 commentaires
Réponses (3)
Star Strider
le 13 Juil 2019
x = linspace(-10, 10, 50);
[X,Y,Z] = meshgrid(x);
V = (X.^2 + Y.^2 + 2*Z.^2);
figure
hp = patch(isosurface(X,Y,Z,V,10))
isonormals(X,Y,Z,V,hp)
hp.FaceColor = 'r';
hp.EdgeColor = 'none';
camlight left;
lighting gouraud
grid on
view(-20,30)
producing:
![how to plot ellipsoid - 2019 07 13.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/229678/how%20to%20plot%20ellipsoid%20-%202019%2007%2013.png)
2 commentaires
Matt J
le 11 Avr 2021
Modifié(e) : Matt J
le 11 Avr 2021
You can also use,
which has the convenience of letting you specify yaw/pitch/roll angles for the ellipsoid.
[Center,ABC,YPR]=deal([0 2 1] , [6 2 1], [60 40 0]); %center, radii, yaw/pitch/roll
obj=ellipsoidalFit.groundtruth([],Center,ABC,YPR);
plot(obj, {'FaceColor', 'm'});
xlabel X; ylabel Y; zlabel Z
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/580002/image.png)
0 commentaires
Voir également
Catégories
En savoir plus sur Lighting, Transparency, and Shading dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!