Is it possible to multiply a 3x3 matrix by the COLUMNS of a 3x3 matrix without using a loop and store the results in a new 3x3matrix?

1 vue (au cours des 30 derniers jours)
For example if I have the matrix z = [1 2 3; 1 2 3; 1 2 3] and I have another matrix t = [ 2 2 2; 2 2 2; 2 2 2]. I want to multiply z by the first, second and third row of t. So by the end of this process I should have three vectors of the size 3x1 that should be placed right next to each other to create a 3x3 matrix. I have already done this using a for loop, but I was wondering if there was a faster way to do this because the matlab program I am building, I am multiplying a 3x3 matrix by the columns of a 3 x 1000 matrix.

Réponses (1)

Roger Stafford
Roger Stafford le 26 Fév 2016
Is this what you mean:
z.*t

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by