필터 지우기
필터 지우기

Surf data dimension must agree

조회 수: 61 (최근 30일)
DIMITRY
DIMITRY 2015년 7월 24일
댓글: DIMITRY 2015년 7월 27일
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,

답변 (1개)

Walter Roberson
Walter Roberson 2015년 7월 24일
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.
  댓글 수: 1
DIMITRY
DIMITRY 2015년 7월 27일
Understood mate. Thanks

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by