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

1 view (last 30 days)
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)

Azzi Abdelmalek
Azzi Abdelmalek on 24 Jul 2014
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
Franco Gentili
Franco Gentili on 24 Jul 2014
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.

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!