I have a matrix A
and a vector x
:
A
is a 50x30 matrix
x
is a 1x30 vector
I want to multiply A
by x
, yet whenever I try z = A * x
I get the error Inner matrix dimensions must agree.
Yet surely with the same amount of columns the matrix dimensions do agree?
I'm confused as to why this works:
A = rand(2,2);
x = [1;2];
A * x
Yet this does not work:
A = rand(2,2);
x = 1:2;
A * x