필터 지우기
필터 지우기

Solving non linear equations in a 4x2 matrix

조회 수: 3 (최근 30일)
Ali Awada
Ali Awada 2020년 10월 9일
댓글: Ameer Hamza 2020년 10월 9일
Hello,
I am trying to calculate the roots of a system of non-linear equations:
[1 1;x y;x^2 y^2;x^3 y^3]*[a;b]=[2;0;2/3;0]
x,y,a, and b are unknowns
When i try to solve the system it gives ans=struct with fields.
can someone help out

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 10월 9일
If you have symbolic toolbox, you can use solve() function
syms x y a b
eq = [1 1;x y;x^2 y^2;x^3 y^3]*[a;b]==[2;0;2/3;0];
sol = solve(eq);
The system have two solutions. sol is a struct. You can access the solution like this
>> sol.x
ans =
3^(1/2)/3
-3^(1/2)/3
>> sol.y
ans =
-3^(1/2)/3
3^(1/2)/3
>> sol.a
ans =
1
1
>> sol.b
ans =
1
1
  댓글 수: 4
Ali Awada
Ali Awada 2020년 10월 9일
Thanks!
Ameer Hamza
Ameer Hamza 2020년 10월 9일
I am glad to be of help!!!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by