How to convert 2D plot to 3D.

1 回表示 (過去 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 Center および File ExchangeLine Plots についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by