How to convert 2D plot to 3D.

조회 수: 20 (최근 30일)
Vahram Voskerchyan
Vahram Voskerchyan 2021년 12월 8일
답변: DIVYA K 2022년 8월 10일
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
Rik
Rik 2021년 12월 8일
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 2021년 12월 8일
I want to rotate it clockwaise with the shape it has.

댓글을 달려면 로그인하십시오.

채택된 답변

Matt J
Matt J 2021년 12월 8일
편집: Matt J 2021년 12월 8일
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
Vahram Voskerchyan
Vahram Voskerchyan 2021년 12월 9일
thanks a lot for your answer! didn't know about the deal command.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

DIVYA K
DIVYA K 2022년 8월 10일
is there chance to do this line graph into 3D graph

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by