How do I get the solutions to this system of eqns
2 views (last 30 days)
Show older comments
x = [ 1 1 1; -3 3+5i 3-5i; 9 34+30i 34-30i];
y = [28/3;15/2;9];
2 Comments
Les Beckham
on 17 Oct 2023
x = [ 1 1 1; -3 3+5i 3-5i; 9 34+30i 34-30i]
y = [28/3;15/2;9]
That is not a system of equations, it is two assignment statements that create a complex matrix and a real column vector. Please specify the actual equation that you wish to solve.
Answers (2)
Sulaymon Eshkabilov
on 17 Oct 2023
Simply use \, linsolve(), inv(), etc. E.g.:
x = [ 1 1 1; -3 3+5i 3-5i; 9 34+30i 34-30i];
y = [28/3;15/2;9];
Solution1 = linsolve(x,y)
Solution2 = x\y
Solution3 = inv(x)*
0 Comments
Sulaymon Eshkabilov
on 17 Oct 2023
You may also try lsqr(), rref(), svd(), and solve() with syms. E.g.:
x = [ 1 1 1; -3 3+5i 3-5i; 9 34+30i 34-30i];
y = [28/3;15/2;9];
Solution4 = lsqr(x,y)
Sol = rref([x,y]);
Solution5 = Sol(:,end)
% svd()
[U,S,V]=svd(x);
Solution6 = V*inv(S)*U'*y
% solve() with syms --> NOT recommended though
syms x y z
A = [ 1 1 1; -3 3+5i 3-5i; 9 34+30i 34-30i];
b = [28/3;15/2;9];
Eqn = A*[x;y;z]==b;
Sol = solve(Eqn)
Solution7 = double([Sol.x; Sol.y; Sol.z])
0 Comments
See Also
Categories
Find more on Linear Algebra 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!