Converting tabulated data to 3D plot

Hi,
I have the attached table. I would be grateful if you can tell me how to show it in 3D ( Red--> x ; Green--> Y & White cells-->Z)
Thanks, Ehsan

 採用された回答

Stephan
Stephan 2018 年 6 月 28 日
編集済み: Stephan 2018 年 6 月 28 日

1 投票

Hi,
define a vector x
x = [0 10 30 60 120 -10];
define a vector y
y = 1000:1000:7000;
and calculate/write your z values in a matrix z = [size(y), size(x)].
In this example i use random integers:
z = randi(100,length(y),length(x));
Then use the surf function:
surf(x,y,z)
to get a 3D surface plot from your data.
Note that this procedure sorts your vector x in ascending order. if you want to avoid this, use:
surf(z)
and change the values that are used for the labeling of the axes by using your values from x and y.
Best regards
Stephan

1 件のコメント

Ehsan Nikjoo
Ehsan Nikjoo 2018 年 6 月 30 日
Thanks Stephan. It solved my problem.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

質問済み:

2018 年 6 月 28 日

コメント済み:

2018 年 6 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by