How to solve equations with more unknowns
Show older comments
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 Comments
seems like a system of 3 linear equations with 3 parameters. If I got it right, all you need is to declare your parameters (pi, pj, pk) as symbolic variables, and send these equations to solve function.
Bruno Luong
on 9 Nov 2018
What's that means?
pi.xi
Awais Saeed
on 9 Nov 2018
@awais Saeed, I think bruno ment what do you mean by the syntax
pi.xi
I assumed you ment multiplation, which you should right like that so it is clear
pi*xi
Walter Roberson
on 10 Nov 2018
Instead of solve() you can probably use the numeric \ operator.
madhan ravi
on 10 Nov 2018
TADA its working.
is pi a struct with values?
Awais Saeed
on 10 Nov 2018
Awais Saeed
on 10 Nov 2018
Accepted Answer
More Answers (0)
Categories
Find more on Numeric Solvers in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!