¿Como puedo multiplicar estas matrices?

1 回表示 (過去 30 日間)
Pablo Álvarez García
Pablo Álvarez García 2022 年 2 月 28 日
回答済み: Bhanu Prakash 2023 年 10 月 17 日
la matriz y es una matriz de 1x192016 double, como puedo hacer esta multiplicación sin que me de un error?
div=[7, 13, 19, 25, 31, 37, 43];
y1=y.*(0:div(1))

回答 (1 件)

Bhanu Prakash
Bhanu Prakash 2023 年 10 月 17 日
Hi Pablo,
I understand that you want to multiply two matrices without getting any error.
To perform element wise multiplication on any given two matrices, their indexes must be same or be compatible. For more information on the compatibility of the matrices, refer to the following documentation:
In your case, the sizes of the matrix ‘y’ and ‘z’ are (1x192016) and (1x8) respectively making the sizes incompatible. To avoid the error, make sure that the array sizes are same or compatible as mentioned in the above documentation.
For more information on the matrix multiplication, refer to the following documentation:

タグ

Community Treasure Hunt

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

Start Hunting!