필터 지우기
필터 지우기

How to solve (ax+2by) = -5 & (-3x+2by) = 7, in MAT Lab by symbolic math add ons?

조회 수: 1 (최근 30일)
Jawed
Jawed 2023년 5월 23일
댓글: Anish Gupta 2023년 5월 23일
Solve (ax+2by) = -5 & (-3x+2by) = 7, in MATLab by symbolic math add ons?
  댓글 수: 2
Dyuman Joshi
Dyuman Joshi 2023년 5월 23일
What are a and b supposed to be?
Also look into syms
Jawed
Jawed 2023년 5월 23일
I want this solution for variable 'x' and 'y', 'a' & 'b' are constant. Thanks.

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

채택된 답변

Anish Gupta
Anish Gupta 2023년 5월 23일
Hello,
As per my understanding, you want to symbolically solve two equations. However, it is not clear from your question, for which variable you want to solve the questions. So, I am assuming you want to solve for either 'x' and 'y', or 'a' and 'b'. Here is a code which shows how to do this:
syms x y a b
eqn=[a*x + 2*b*y==(-5),-3*x+2*b*y==7];
solve(eqn,[x,y])
ans = struct with fields:
x: -12/(a + 3) y: (7*a - 15)/(2*(3*b + a*b))
Here is the solution for variables 'a' and 'b'
solve(eqn,[a,b])
ans = struct with fields:
a: -(3*(x + 4))/x b: (3*x + 7)/(2*y)
I hope this resolves your query
  댓글 수: 2
Jawed
Jawed 2023년 5월 23일
Thank you very much for providing solution. I want this solution for variable 'x' and 'y'. Thanks again.
Anish Gupta
Anish Gupta 2023년 5월 23일
The solution for 'x' and 'y' are the first three lines of the code
syms x y a b
eqn=[a*x + 2*b*y==(-5),-3*x+2*b*y==7];
solve(eqn,[x,y])
ans = struct with fields:
x: -12/(a + 3) y: (7*a - 15)/(2*(3*b + a*b))

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by