Plot figure with 3 matrix 1D x y z like a surface

Three matrices are x y z coordinates for a figure.
... x=[1:10]
y=[11:20]
z=[21:30] ...
Which command can be used to plot surface with x y z? (Tried "surf" and "mesh" command but they are not working)

4 Commenti

What should the result look like?
We could speculate that you want to define all the combinations of x and y values, like (1,11), (1,12), ... (2,11), (2,12), ... (10,19), (10,20). But which z value should go with which of those combinations? Or are you trying to define a cube, like
Cube = zeros(40,40,40);
Cube(x, y, z) = 1;
?
Combination fo x y and z values like (1,11,21)... can be considered like point. All points can be made like a surface.
You have only shown one combination. Should it always be the triples x(K), y(K), z(K), like x(1), y(1), z(1); x(2), y(2), z(2)? If so then you are defining a line, not a surface.
Or can you have x(1), y(3), z(5) for example, all combinations of all x values with all y values with all z values? If that is the case then you are defining a volume rather than a surface.
Ok! I got it.
Thanks!

Accedi per commentare.

 Risposta accettata

plot3(x, y, z)
This is the surface plot you seem to be requesting. It is a degenerate surface.

Più risposte (0)

Richiesto:

ly
il 22 Ott 2015

Commentato:

ly
il 22 Ott 2015

Community Treasure Hunt

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

Start Hunting!

Translated by