How do I get the solutions to this system of eqns
2 ビュー (過去 30 日間)
古いコメントを表示
x = [ 1 1 1; -3 3+5i 3-5i; 9 34+30i 34-30i];
y = [28/3;15/2;9];
2 件のコメント
Les Beckham
2023 年 10 月 17 日
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.
回答 (2 件)
Sulaymon Eshkabilov
2023 年 10 月 17 日
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 件のコメント
Sulaymon Eshkabilov
2023 年 10 月 17 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Linear Algebra についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!