Calculating optimum using fminbnd
古いコメントを表示
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.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Simscape Multibody についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!