How to convert 2D plot to 3D.

21 vues (au cours des 30 derniers jours)
Vahram Voskerchyan
Vahram Voskerchyan le 8 Déc 2021
Réponse apportée : DIVYA K le 10 Août 2022
I have a plot that gives me the following plot.
plot(field0(:,1), field0(:,2))
xlim([-0.1 0.02])
Is it possible to convert this to 3D plot that will look something like this?
  6 commentaires
Rik
Rik le 8 Déc 2021
In that case you must first try to find the peak point and decide how exactly you want to rotate. Do you want to make it symetrical? The plot you showed isn't symetrical itself, so how should the code deal with that?
Vahram Voskerchyan
Vahram Voskerchyan le 8 Déc 2021
I want to rotate it clockwaise with the shape it has.

Connectez-vous pour commenter.

Réponse acceptée

Matt J
Matt J le 8 Déc 2021
Modifié(e) : Matt J le 8 Déc 2021
You must select one of the infinite possible 3D extensions that you want and tell us what it is.
One possibility:
load field0
x=field0(:,1);
idx=abs(x)<0.08;
[x,y,z]=deal(x(idx),x(idx),field0(idx,2));
surf(x,y,z*z.','MeshStyle','row'); view(10,60)
  1 commentaire
Vahram Voskerchyan
Vahram Voskerchyan le 9 Déc 2021
thanks a lot for your answer! didn't know about the deal command.

Connectez-vous pour commenter.

Plus de réponses (1)

DIVYA K
DIVYA K le 10 Août 2022
is there chance to do this line graph into 3D graph

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by