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:
- diff: http://www.mathworks.com/help/symbolic/diff.html
- fminbnd: http://www.mathworks.com/help/matlab/ref/fminbnd.html
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!