How can i rearrange expressions?

1 Ansicht (letzte 30 Tage)
WAYNE ONG
WAYNE ONG am 2 Nov. 2021
Beantwortet: DGM am 2 Nov. 2021
I have 3 expressions D S L that depends on X Y Z a b
what function can i use to rearrange them to X Y Z that depends on D S L a b
i.e.
input:
D = -(X*cos(a)+Z*sin(a))*cos(b) - Y*sin(b);
S = (X*cos(a)+Z*sin(a))*sin(b) - Y*cos(b);
L = X*sin(a) - Z*cos(a);
output:
X = f(D,S,L,a,b)
Y = f(D,S,L,a,b)
Z = f(D,S,L,a,b)

Akzeptierte Antwort

DGM
DGM am 2 Nov. 2021
Consider:
syms a b D S L X Y Z
e1 = D == -(X*cos(a)+Z*sin(a))*cos(b) - Y*sin(b);
e2 = S == (X*cos(a)+Z*sin(a))*sin(b) - Y*cos(b);
e3 = L == X*sin(a) - Z*cos(a);
S = solve([e1 e2 e3],[X Y Z]);
% observe results
S.X
ans = 
S.Y
ans = 
S.Z
ans = 

Weitere Antworten (0)

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by