필터 지우기
필터 지우기

Rearrange an equation to solve for a different variable

조회 수: 2 (최근 30일)
Brian Kirkland
Brian Kirkland 2022년 4월 13일
답변: Sam Chak 2022년 4월 14일
Hello,
I am trying to rearrange the equation "eqn" to solve for (isolate the variable) "t" but my current code will not produce an answer.
Is there a different function/ solver I should use instead?
Thank you.

답변 (1개)

Sam Chak
Sam Chak 2022년 4월 14일
If the explicit solution cannot be found, then it is probably a transcendental equation, just like this one:
.
So, you need to employ the numerical approach:
fun = @(x) x + sin(x) - 2; % nonlinear function
x_guess = 1; % initial guess
sol = fzero(fun, x_guess) % solution
sol = 1.1061

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by