how can i multiply two matrices?
Ältere Kommentare anzeigen
I have a matrix 'a' with size 3x3 and 'b' with size 3x1.i want to multiply the inverse of 'a' with matrix 'b'.I tried the below code but got an error "Matrix dimensions must agree". please help to solve this
a=[1 0 -3; 2 -2 1; 0 -1 3];
inv_a=inv(a);
b=[0;2;121];
c=inv_a.*b;
2 Kommentare
Beder
am 23 Feb. 2017
This code does not produce any error on my system. Maybe you have a variable called "inv" which overlays the function "inv"?
Walter Roberson
am 23 Feb. 2017
Beder,
I suspect you are using R2016b, which introduced automatic vector expansion as if bsxfun() had been used.
Akzeptierte Antwort
Weitere Antworten (1)
Alicia Palmerin-Jimenez
am 5 Mär. 2022
0 Stimmen
no
Kategorien
Mehr zu Linear Algebra finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!