-
1
- #1
komlan
Computer
- Jun 2, 2005
- 1
Hi everyone,
I'm new to MatLab and to this forum, and so my question may seem trvial.
I need to plot a 3D figure from 3 vectors x, y, z. The 3 vector are related simply by order of their elements, that is, each point of my plot will have coordinate (x(i), y(i), z(i))
I checked the MatLab help for functions such as mesh and surf but they seem to be suitable only for close forme expression as in the following example.
[X,Y] = meshgrid(-2:.2:2, -2:.2:2);
Z = X .* exp(-X.^2 - Y.^2);
surf(X,Y,Z)
[x and y are transformed into matrix with meshgrid and Z is generated by calling some funstion f(X,Y)]
The problem in my case in that the x,y,z vectors are experiment data and so I do not generate z with x and y.
Am I missing the whole thing? Can anybody help please?
Thanks
Komlan
I'm new to MatLab and to this forum, and so my question may seem trvial.
I need to plot a 3D figure from 3 vectors x, y, z. The 3 vector are related simply by order of their elements, that is, each point of my plot will have coordinate (x(i), y(i), z(i))
I checked the MatLab help for functions such as mesh and surf but they seem to be suitable only for close forme expression as in the following example.
[X,Y] = meshgrid(-2:.2:2, -2:.2:2);
Z = X .* exp(-X.^2 - Y.^2);
surf(X,Y,Z)
[x and y are transformed into matrix with meshgrid and Z is generated by calling some funstion f(X,Y)]
The problem in my case in that the x,y,z vectors are experiment data and so I do not generate z with x and y.
Am I missing the whole thing? Can anybody help please?
Thanks
Komlan