can fzero be used to find the minimum ?

7 ビュー (過去 30 日間)
Naveen Ramesh
Naveen Ramesh 2013 年 4 月 29 日
Can fzero command be used to find the minimum of a function or a curve ? as in if i want to plot a function over a period and also want to find the minimum, is fzero command the best option and if so, how do i use it to find the minimum ?

採用された回答

Kye Taylor
Kye Taylor 2013 年 4 月 29 日
編集済み: Kye Taylor 2013 年 4 月 29 日
Do you have the optimization toolbox?
To start you can begin with the fminbnd function. For example, say your function is g(x) = -x^2*exp(-x) for 0<x<10. You can find the minimum of the function on the specified interval using the commands
% define a function handle
g = @(x) -x.^2.*exp(-x);
% find minimum on specified interval
[xMin,fVal] = fminbnd(g,0,10);
% visualize
t = linspace(0,10);
plot(t,g(t),xMin,fVal,'ro')
  1 件のコメント
Naveen Ramesh
Naveen Ramesh 2013 年 4 月 29 日
thanks a lot kye ..!!!

サインインしてコメントする。

その他の回答 (1 件)

Matt J
Matt J 2013 年 4 月 29 日
Use FMINSEARCH or FMINBND instead.

カテゴリ

Help Center および File ExchangeOptimization についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by