How can i rearrange expressions?

1 回表示 (過去 30 日間)
WAYNE ONG
WAYNE ONG 2021 年 11 月 2 日
回答済み: DGM 2021 年 11 月 2 日
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)

採用された回答

DGM
DGM 2021 年 11 月 2 日
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 = 

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by