How do I use numeric solvers to solve for t?

조회 수: 2 (최근 30일)
Matthew Orsie
Matthew Orsie 2017년 12월 5일
댓글: Star Strider 2017년 12월 5일
For my project I have to use a numeric solver to solve an equation for it's unknown variable, t. There's 5 equations total and some are longer than others so I'll just use the easiest one as an example.
exp(-0.0287*t)=(1/2)
How would I make MATLAB solve this equation for me? Thank you.
(I realize that I can do this by hand, but my project REQUIRES me to do it on MATLAB)

답변 (2개)

Roger Stafford
Roger Stafford 2017년 12월 5일
You don't need matlab to solve that equation for t.
exp(-0.0287*t)=(1/2)
-0.0287*t = log(1/2) = -log(2)
t = log(2)/0.0287
You should ask about more difficult equations than that.
  댓글 수: 1
Matthew Orsie
Matthew Orsie 2017년 12월 5일
I can do it by hand but my project literally REQUIRES me to do it this way.

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


Walter Roberson
Walter Roberson 2017년 12월 5일
f = @(t) exp(-0.0287*t);
x0 = rand(); %starting point
fzero( @(t) f(t) - 1/2, x0)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by