Filter löschen
Filter löschen

Surf data dimension must agree

61 Ansichten (letzte 30 Tage)
DIMITRY
DIMITRY am 24 Jul. 2015
Kommentiert: DIMITRY am 27 Jul. 2015
Hi,
I have a surf running on the following
X --> size as 31 x 1
Y --> size as 31 x 1
Z --> size as 31 x 2 after transposed
Could you help me to figure out how a surf is not working properly as the error message returned is about data dimensions must agree.
Thanks,

Antworten (1)

Walter Roberson
Walter Roberson am 24 Jul. 2015
For surf() when your X and Y are vectors, your Z must be length(X) x length(Y) . In this case that would be 31 x 31.
If you what you have is a list of coordinates (X,Y,Z(:,1)) and (X,Y,Z(:,2)) then that would be scattered data and you would need to interpolate it over a grid in order to create a surface. surf() is only for (possibly parametric) grids of data.

Kategorien

Mehr zu Graphics Performance finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by