1

I have an exercise that uses Matlab to program a function to approximate a solution of function using fixed-point iteration method and a tolerance. However, I'm getting stuck at calculate the local minimum of first differentiation of a function. I've search and found two function in Matlab:

But I can't combine them to solve my problem. For example, I define f.m file

function y = f(x)
    y = 2-1/x;
end

These command worked:

syms x
diff(f(x)'')
fminbnd(@f, 2, 4)

but I don't know how to pass diff(f(x)'') to fminbnd.

Any help, please.

Thanks!

Dev-iL
  • 23,742
  • 7
  • 57
  • 99
khôi nguyễn
  • 626
  • 6
  • 15
  • 2
    Read here: http://www.mathworks.com.au/help/symbolic/matlabfunction.html. Actually, why do you think you should be able to pass a derivative to `fminbnd`? Or are you trying to minimise the derivative? – David Sep 29 '14 at 05:10
  • Thanks. My exercise require an parameter that is the minimum of first derivatives. Now I can using them. But now I get another trouble when trying to use diff in *.m file :v – khôi nguyễn Sep 29 '14 at 07:18

0 Answers0