How to solve the exponential equation?

1 view (last 30 days)
Yongjun Park
Yongjun Park on 2 Jul 2014
Commented: Star Strider on 3 Jul 2014
Hi, I want to solve the equation as follows:
a^x = b^x + c
(a,b,c are the constant)
How can I get the 'x' using matlab?
please help me. thank you.

Answers (1)

Star Strider
Star Strider on 3 Jul 2014
It is sensitive to the values of the constants, but this code works:
a = .3;
b = .5;
c = .7;
fcn = @(x,a,b,c) a.^x - b.^x - c;
X = fzero(@(x) fcn(x,a,b,c), 10)
produces:
X =
-701.0091e-003
  2 Comments
Star Strider
Star Strider on 3 Jul 2014
My pleasure!
(The most sincere expression of thanks on MATLAB Answers is to Accept the Answer that most closely solves your problem.)

Sign in to comment.

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!