MATLAB: Matrix differentiation

differentiation

Hi
I have matrix (3,3)in the form
M=[cos(a)*sin(b)*cos(c) sin(a)*sin(b)*sin(c) cos(a)^2*sin(b)^2*cos(c);………….;…….]
where a , b , c angls changing with the time
How i can differentiation the M according to time Mdott
Thx

Best Answer

syms a b c t
M=[cos(a)*sin(b)*cos(c) sin(a)*sin(b)*sin(c) cos(a)^2*sin(b)^2*cos(c)];
k = regexprep(char(M),{'\(a\)','\(b\)','\(c\)'},{'\(a\(t\)\)', '\(b\(t\)\)', '\(c\(t\)\)'});
out = feval(symengine,'diff', k, t)
ADD after rami's comment
z = feval(symengine,'diff', k, t);
out = sym(regexprep(char(z),'(\(t\))|(\*diff\([abc]\(t\), t\))',''))