Linear equations with three unknowns
显示 更早的评论
New to matlab, trying to solve something like this (this is just an exampe)
120x - 55y - 75z = 0
111x - 67y - 21z = 0
34x - 92y - 11z = 0
but it is known that x^2 + y^2 + z^2 = 1
im trying to end up with x and z so i can use this ^ to find y
Thank you
回答(1 个)
Hi Ahmed,
The problem in the Question is ill-defined becasue there are no values of (x,y,z) that satisfy all four equations.
A = [120 -55 -75;111 -67 -21]; % first two equations from the Question
p = fsolve(@(p) [A*p(:);sum(p.^2)-1],[1 0 0]) % p = [x y z]
For this problem, p is simply the unit-norm basis vector for the null space of A, as it should be
null(A)
类别
在 帮助中心 和 File Exchange 中查找有关 Mathematics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!