MATLAB: Matrix Multiplication Error: I have a 1×4 and a 4×4 that I am attempting to multiply. Matlab is giving me an error stating “Inner matrix dimensions must agree”. C=[0;1;0;0]; A=[0 0 1 0; 0 0 0 1; -36 36 -3/5 3/5; 18 -18 3/10 -3/10]

MATLABMATLAB and Simulink Student Suitematrixmatrix manipulationmatrix multiplication

Matrix 1 is –> C=[0;1;0;0]; Matrix 2 is –> A=[0 0 1 0; 0 0 0 1; -36 36 -3/5 3/5; 18 -18 3/10 -3/10];

Best Answer

C is not 1x4 but 4x1, transpose it (C')
C'*A