Does anyone know how to fix this?

조회 수: 2 (최근 30일)
Rascal07
Rascal07 2018년 1월 26일
댓글: Jan 2018년 1월 26일
I am trying to plot a pcolor using the variables: elevation [3543x2413 double], lat [2413x1 double], lon [3543x1 double],
However i keep getting the error 'Matrix dimensions must agree' does anyone know which dimentions i need to make agree?
  댓글 수: 1
Jan
Jan 2018년 1월 26일
If you post your code, the readers can reconsider, what you are doing. Currently it is required to guess the cause of the error.

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

채택된 답변

Guillaume
Guillaume 2018년 1월 26일
Seeing the actual code you're using would help.
Works fine for me:
hsurf = pcolor((1:2413).', (1:3543).', rand(3543, 2413))
hsurf.EdgeAlpha = 0; %otherwise all you see is the black from the edges
Have you swapped the X and Y coordinates by any chance? Remember that X corresponds to columns and Y to rows.
  댓글 수: 1
Rascal07
Rascal07 2018년 1월 26일
yep simple mistake found it shortly after posting, thanks anyway

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

추가 답변 (1개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by