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
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

更多回答(0 个)

类别

Community Treasure Hunt

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

Start Hunting!

Translated by