The error is a part of the exercise. It is meant to motivate understanding of matrices with inconsistent sizes. Type size(A) and then size(C), and compare the dimensions.
May be Vectors have not proper number of raw and columns to multiply.
to substract two matrices number of rows and cols of both matrix must be same.
rows and cols of A*C and C*A are different.
so its giving substraction error
The same reason for multiplication operation also. Please check the condition for matrix multiplication operation.
In statement 1 A*C returns 3*3 matrix and C*A returns 2*2 matrix so subtraction is not possible.
In statement 2 2*C returns 2*3 matrix and 6*A returns 3*2 matrix again so subtraction possible in that case.
In statement 3 2*C-6*A' returns 2*3 matrix and B' returns 2*1 matrix so multiplication is not feasible as no. of columns of first are not equal to no. of rows of second.
I think this will help.