Matrix dimensions must agree
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi! Mi program show me a mistake with my matrix but both have nine values in x and y.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/302638/image.png)
댓글 수: 0
답변 (1개)
Tommy
2020년 5월 27일
A is a 4x9 array, so A' is a 9x4 array.
A.*A'
This tries to use element-wise multiplication on A and A', but they aren't the same size (or compatible), so you get an error.
Maybe you mean this?
a=A*A'\A*y';
This performs matrix multiplicaton on A and A', resulting in a 4x4 array which you can then pass to mldivide along with A*y' (a 4x1 array).
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!