How to multiple a 3x3 double matrices time 2355x1 double matrices
3 次查看(过去 30 天)
显示 更早的评论
I'm trying to multiply a 3x3 double matrices time 2355x1 double matrices and when I tried to run the code I get this message( Arrays have incompatible sizes for this operation).
how do I multiply them
2 个评论
the cyclist
2023-2-27
What do you expect to happen? A 3x3 matrix and a 2355x1 vector don't have compatible sizes for either matrix multiplication or element-wise multiplication.
Let's take a smaller example. Suppose you have a 3x3 matrix and a 4x1 vector:
M = magic(3)
V = [2; 3; 5; 7]
What output do you expect from these?
Walter Roberson
2023-2-27
Output = Matrix_3_by_3 * reshape(Vector2355, 3, []);
maybe ??? The output would be 3 x 785
回答(1 个)
Pratheek
2023-3-1
To multiply any two matrices the basic condition that needed to be satisfied is, the number of columns in the first matrix must be equal to the number of rows in the second matrix. The resulting matrix will have the same number of rows as the first matrix and the same number of columns as the second matrix.
Suppose we have two matrices A and B, with dimensions 2x2 and 2x3, respectively:
A = [2 3; 4 5]
B = [1 2 3; 4 5 6]
then the resulting matrix will be of 2x3.
C= AxB = [14 19 24; 24 33 42]
So, to answer your question, its mathematically not possible to multiply those two matrices(3x3 with a 2355x1).
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!