Matrix differentiation
91 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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
0 Kommentare
Akzeptierte Antwort
Andrei Bobrov
am 6 Jun. 2012
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\))',''))
Weitere Antworten (1)
Walter Roberson
am 6 Jun. 2012
I am relatively sure the below should work:
syms a b c t
M=[cos(a(t))*sin(b(t))*cos(c(t)) sin(a(t))*sin(b(t))*sin(c(t)) cos(a(t))^2*sin(b(t))^2*cos(c(t));.............;.......]
diff(M, t)
What might also work, at least with sufficiently new Symbolic Toolbox, is
syms a(t) b(t) c(t) t
M=[cos(a)*sin(b)*cos(c) sin(a)*sin(b)*sin(c) cos(a)^2*sin(b)^2*cos(c);.............;.......]
diff(M,t)
Siehe auch
Kategorien
Mehr zu Conversion Between Symbolic and Numeric finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!