confusion regarding Matrix dimension.
이전 댓글 표시
Hello,
I have a B matrix in my model having a size of 5x5. I want to multiply B matrix with S matrix which is 5x6. So I am assuming an additional raw in matrix B as [ 0 0 0 0 0]. This way my Matrix B will be 6x5 and I am doing S*B.
Is this the right method? Am I doing right or wrong? Can I assume a null raw? Please help me.
댓글 수: 3
EDIT: Sorry, initially misread your question. To do S*B, the number of columns in S must be the same as the number of rows in B. But this is just basic matrix multiplication, and not really matlab-related. I need more information about your calculation to know whether a zero row makes sense or not.
Bhavik
2015년 1월 21일
Ced
2015년 1월 21일
I'm sorry, I have no idea what the actual question is. But if Smatrix and Bmatrix are 6x5, then Smatrix'.*Bmatrix is not going to work, no matter if Bmatrix is 5x5 or 6x5, since Smatrix' and Bmatrix need to have the same number of elements.
I think Stephen Cobeldick is correct: You need to have a look at the difference between matrix multiplication S*B and element-wise multiplication S.*B.
답변 (1개)
Stephen23
2015년 1월 20일
카테고리
도움말 센터 및 File Exchange에서 Mathematics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!