Page 1 of 1

Matrix dimensions must agree.

Posted: Thu Dec 15, 2016 1:09 pm
by matlab1
One of the common error in MATLAB is :
Matrix dimensions must agree.

This error happen in many situation :

When you wan to put the output of an array in a another array. for example :

A = zeros (3,1)

B =[5,6]

if you write :

A=B

MATLAB will appear this error for you. As you see length of A is 3, But length of B is 2 . So, MATLAB can not put two values in three places.