Calculating optimum using fminbnd
Show older comments
I am trying to use fminbndto calculate an optimum value. I want to define the function and use this with fminbnd. However I get many errors. Clearly it is necessary to use more definitions. My input and the result was:
f = @(x)p1*x^4 + p2*x^3 + p3*x^2 + p4*x + p5
f =
@(x)p1*x^4+p2*x^3+p3*x^2+p4*x+p5
>> >> x = fminbnd(f, 0, 1000) Undefined function or variable 'p1'.
Error in @(x)p1*x^4+p2*x^3+p3*x^2+p4*x+p5
Error in fminbnd (line 215) x= xf; fx = funfcn(x,varargin{:});
>> will someone please either help me modify this or direct me to an appropriate link that will assist me further?
Gavin.
Accepted Answer
More Answers (0)
Categories
Find more on Simscape Multibody 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!