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!