Filter löschen
Filter löschen

Difference in TriSurf and Surf - Adding Two trisurf plot on one graph.

3 Ansichten (letzte 30 Tage)
Afz
Afz am 9 Dez. 2012
I uses this to get a surface plot between three variables. My data was in one column.
trisurf(tri,x,y,z)
But when I use Surf(x,y,z) it gives error "??? Undefined function or variable 'X'."
Also I have 10 sets of data how can I plot more than one surface on one graph in a different color.

Antworten (1)

Walter Roberson
Walter Roberson am 9 Dez. 2012
Note that MATLAB is case-sensitive, so if you defined a variable "x" then "X" is a different variable. Also, Surf() would be different than surf()
Please show your exact code.
To plot multiple surfaces, use "hold on" after the first plot. You can pass color information to surf()
  3 Kommentare
Walter Roberson
Walter Roberson am 9 Dez. 2012
surf() is simply not designed to handle vectors of X, Y, Z. It is designed for working on grids of data.
It is not clear to me why you are looking to use surf() when you are already using trisurf() ? If there is a good reason to use surf() instead, then see TriScatteredInterp
indata = xlsread('YourFileName.xls');
x = indata(1:26, 1);
y = indata(2:27, 2);
z = indata(3:28, 3);
Walter Roberson
Walter Roberson am 18 Dez. 2012
contour() requires grids of data too. You need exactly the same preparation work for contour() that you need for surf()

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Lighting, Transparency, and Shading finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by