How to solve equations with more unknowns

1 visualización (últimos 30 días)
Awais Saeed
Awais Saeed el 9 de Nov. de 2018
Respondida: Walter Roberson el 10 de Nov. de 2018
I want to write a code to find pi,pj and pk. How to solve these equations, all x and y terms are known.
Eq1 : x=pi.xi + pj.xj + pk.xk
Eq2 : y=pi.yi + pj.yj + pk.yk
Eq3 : pi + pj + pk = 1
  8 comentarios
Awais Saeed
Awais Saeed el 10 de Nov. de 2018
Yes it is multiplication(pi*xi). Pi,pj,pk are variables not struct.
Awais Saeed
Awais Saeed el 10 de Nov. de 2018
@walter roberson i have solved the equations with solve() command. But how with numeric \ operator

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 10 de Nov. de 2018
A = [xi, xj, xk;
yi, yj, yk;
1, 1, 1];
b = [x;
y;
1];
sol = A\b;
pi = sol(1); pj = sol(2); pk = sol(3);

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by