# Finding Symbolic Matrix Derivative

3 visualizzazioni (ultimi 30 giorni)
JPS il 8 Mag 2021
Risposto: Paul il 8 Mag 2021
I have the following Matrix and I wish to find its derivative,
A =
Please note that ϕ and θ in this matrix are functions of time t.
I have the following MATLAB code,
syms phi theta t real
A = [1 , 0 , -sin(theta) ;...
0 , cos(phi) , cos(theta) * sin(phi) ;...
0 , -sin(phi) , cos(phi) * cos(theta)];
Adot = diff(A); % this isn't giving the result I expect
So I tried,
syms phi theta t real
A = [1 , 0 , -sin(theta) ;...
0 , cos(phi) , cos(theta) * sin(phi) ;...
0 , -sin(phi) , cos(phi) * cos(theta)];
phi(t) = phi;
theta(t) = theta;
Adot = diff(A , t); % this also isn't working
The result I want is,
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposte (1)

Paul il 8 Mag 2021
Declare theta and phi as functions, and then substitute after differentiating A
syms phi(t) theta(t) phi_dot(t) theta_dot(t)
A=[1 0 -sin(theta);0 cos(phi) cos(theta)*sin(phi);0 -sin(phi) cos(phi)*cos(theta)]
A(t) =
subs(diff(A,t),diff([phi(t) theta(t)]),[phi_dot(t) theta_dot(t)])
ans(t) =
Note that this result is not the same as the expected result in the question, which appears to have some terms that are incorrect.
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su MATLAB in Help Center e File Exchange

R2020a

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by