How can i rearrange expressions?

1 visualización (últimos 30 días)
WAYNE ONG
WAYNE ONG el 2 de Nov. de 2021
Respondida: DGM el 2 de Nov. de 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)

Respuesta aceptada

DGM
DGM el 2 de Nov. de 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 = 

Más respuestas (0)

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by