필터 지우기
필터 지우기

Rearrange symbolic variables in equation

조회 수: 2 (최근 30일)
jun wei
jun wei 2022년 12월 20일
댓글: jun wei 2022년 12월 20일
Suppose i have an equation a=b*(c-3) and i want to find a/b which is equal to (c-3). How do i code it. P.S I have tried the solve function
eqn = a == b*(c-3);
S = solve(eqn, a/b)
but the result is
S =
struct with fields:
b: [0×1 sym]
c: [0×1 sym]

채택된 답변

Walter Roberson
Walter Roberson 2022년 12월 20일
syms aoverb
S = solve(subs(eqn, a, aoverb*b), aoverb)

추가 답변 (1개)

VBBV
VBBV 2022년 12월 20일
편집: VBBV 2022년 12월 20일
syms a b c ;
eqn = a/b == (c-3);
S = solve(eqn,[ a,b,c])
  댓글 수: 3
VBBV
VBBV 2022년 12월 20일
syms a b c ;
eqn = a/b == (c-3);
S = solve(eqn,[a,b])
S = struct with fields:
a: c - 3 b: 1
lhs(eqn) == S.a % do you mean like this ?
ans = 
jun wei
jun wei 2022년 12월 20일
uhmm not exactly. For instant if a much complicated equation say a+y^2+3x=b*(2x+c) etc and i want to find a/b in terms of those symbolic variables.

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

카테고리

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