I am a novice in Matlab, in my first list of exercises I am asked to calculate the minimum of a function within a specific interval, after passing the parameters to the function fminbnd it gives me the following error.
Undefined function or variable 'x'.
Error in Scriptfmin3 (line 1)
f=x^3-2*x-5
Error in run (line 63)
evalin('caller', [script ';']);
My script is the following.
f=x^3-2*x-5
fminbnd(f,0,2)
What am I doing wrong
You need to put @(x):