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

 Akzeptierte Antwort

Stephan
Stephan am 28 Jun. 2018
Bearbeitet: Stephan am 28 Jun. 2018

1 Stimme

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

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by