MATLAB: How to multiply 7 x 1 matrix with 400 x 1 matrix

matrix

How to multiply 7 x 1 matrix with 400 x 1 matrix?

Best Answer

It's matrix multiplication you can just transpose the matrix to match the rule of matrix multiplication:
a=rand(400,1); %example
b=rand(7,1);
ab=a*b.'; % -> b transposed here, now the size of b is 1 by 7
size(ab) % which will be 400 by 7