How to solve an equation which has another function in it?

1 view (last 30 days)
Hi everyone,
I am trying to solve an equation like
4*x+g(x)=18 where g(x)=2*x+6
meaning that g(x) changes with iterations. I am trying to use solve function, couldn't figure it out.
thanks in advance

Accepted Answer

Star Strider
Star Strider on 18 Apr 2014
Not really sure what you want.
Try this:
g = @(x) 2.*x + 6;
f = @(x) 4.*x + g(x) - 18;
s = fzero(f, 1)

More Answers (0)

Community Treasure Hunt

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

Start Hunting!