syms th d alph l
A = [ cos(th) -cos(alph)*sin(th) sin(alph)*sin(th) l*cos(th);
sin(th) cos(alph)*cos(th) -sin(alph)*cos(th) l*sin(th);
0 sin(alph) cos(alph) d;
0 0 0 1 ];
syms th1
A1 = subs(A,{l,alph,d,th},{0,pi/2,20,th1})
or I use subs numbers in the the matrix, I end uo getting this 4 matrices
A1 =
[cos(th1), 0, sin(th1), 0]
[sin(th1), 0, -cos(th1), 0]
[ 0, 1, 0, 20]
[ 0, 0, 0, 1]
I want to get it in one matrix like below
A1 =
cos(th1), 0, sin(th1), 0;
sin(th1), 0, -cos(th1), 0;
0, 1, 0, 20;
0, 0, 0, 1;
Thank you!