Error message saying "Matrix dimensions must agree"

Hi
Keep getting error message saying "Matrix dimensions must agree".
not too sure why this is.
any help would be greatly appriciated

답변 (1개)

KSSV
KSSV 2020년 11월 27일
"Matrix dimensions must agree".
not too sure why this is.
The error is pretty simple. You will get this error, when you try to add, multiple two matrices which do not obey the rule of addition and mulitplication.
A = rand(3) ; B = rand(2);
A+B % error
A*B % error
In your case too the same thing is happenin. Try to learn how to run the code in debug mode. Run in debug mode, check the dimensions of each and every array and see why the dimensions are no compatible.

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

질문:

2020년 11월 26일

댓글:

2020년 11월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by