Say that I have a matrix:
A = [ 1 2 3 ; 4 5 6 ; 7 8 9 ; 10 11 12];
Is there a way to multiply :
row 1 by 1
row 2 by 2
row 3 by 3
and so on?
I am able to do this with for loops, however it if for an assignment where they want us to use matrices.
In the actual assignment A
is filled with random number but each row which by multiplied consecutively.
Thanks, any help is much appreciated
bsxfun
function - it does exactly what you're looking to do. – Gariepy