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

 Respuesta aceptada

Stephan
Stephan el 28 de Jun. de 2018
Editada: Stephan el 28 de Jun. de 2018
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

Más respuestas (0)

Preguntada:

el 28 de Jun. de 2018

Comentada:

el 30 de Jun. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by