MATLAB: Is it possible to multiply Matrices which contains variables

matrix multiplication

I have 3 matrices of 6×6 dimension, all the elements are variables so now i have to write a code for the multiplication of those matrices, example
Rot1= [a b c ,d e f, g h i] (3×3) Rot2= [j k l, m n o, p q r] (3X3)
now i have to write a code for Rot1*Rot2, is it possible to do that, can anyone help me with that problem.
Thanks in advance
Agastya

Best Answer

Yes, it is. Symbolically (showing it for 2x2):
syms a b c d e f g h
mat1 = [a b; c d];
mat2 = [d e; f g];
mat3 = mat1*mat2