How to solve equations with more unknowns

1 回表示 (過去 30 日間)
Awais Saeed
Awais Saeed 2018 年 11 月 9 日
回答済み: Walter Roberson 2018 年 11 月 10 日
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 件のコメント
Awais Saeed
Awais Saeed 2018 年 11 月 10 日
Yes it is multiplication(pi*xi). Pi,pj,pk are variables not struct.
Awais Saeed
Awais Saeed 2018 年 11 月 10 日
@walter roberson i have solved the equations with solve() command. But how with numeric \ operator

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2018 年 11 月 10 日
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);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumeric Solvers についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by