How to convert 2D plot to 3D.

26 views (last 30 days)
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 Comments
Vahram Voskerchyan
Vahram Voskerchyan on 8 Dec 2021
I want to rotate it clockwaise with the shape it has.

Sign in to comment.

Accepted Answer

Matt J
Matt J on 8 Dec 2021
Edited: Matt J on 8 Dec 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 Comment
Vahram Voskerchyan
Vahram Voskerchyan on 9 Dec 2021
thanks a lot for your answer! didn't know about the deal command.

Sign in to comment.

More Answers (0)

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!