Controllability matrix for a system is given by
Where A is nxn constant matrix and B is n by m constant matrix.

The error occurred because, In your script, you declared A and B matrix with variables as elements. ctrb function works for only constant matrices.