How do I get the solutions to this system of eqns
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
x = [ 1 1 1; -3 3+5i 3-5i; 9 34+30i 34-30i];
y = [28/3;15/2;9];
2 commentaires
Les Beckham
le 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.
Réponses (2)
Sulaymon Eshkabilov
le 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 commentaires
Sulaymon Eshkabilov
le 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 commentaires
Voir également
Catégories
En savoir plus sur Linear Algebra dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!