How to make a graphic 3d(surface) from 3 vectors in MATLAB.

I have for example X = [ 1 3 4 5 6] , Y = [ 2 3 4 5 6] and Z =[ 1 2 3 2 1] and i want to make a surface graphic.
They are in orders, each column represents one point in the coordinate ystem xyz.
I saw many posts but couln´t find the solution.
Thank you in advance.

Answers (1)

To plot a surface you need more data,
Example
x=1:4
y=1:4
[xx,yy]=meshgrid(x,y)
zz=xx.^2+yy.^2 % for example
mesh(xx,yy,zz)

1 Comment

Azzi Abdelmalek i don't have matematical relation betwen x,y and z, they are empirical data. "zz=xx.^2+yy.^2 % for example " this dont work for me.
I can get surface graphic on Excel with the data but i need to do it in Matlab.

Sign in to comment.

Products

Tags

Asked:

on 24 Jul 2014

Commented:

on 24 Jul 2014

Community Treasure Hunt

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

Start Hunting!