How to get fminsearch values for 3 parameters

조회 수: 2 (최근 30일)
Josiah Jarenee Comia
Josiah Jarenee Comia 2021년 4월 26일
댓글: Josiah Jarenee Comia 2021년 4월 26일
I want to get the values of 3 parameters usring fminsearch
for count = 1 : 25 %loop to generate 25 trials
% For Fminsearch
initguess=[1,2]+rand(1,2);
options=optimset('MaxIter',2000,'MaxFunEvals',2000);
[c(count,:),fmin(count,:)]=fminsearch(OFVL,initguess,options);
end

채택된 답변

Walter Roberson
Walter Roberson 2021년 4월 26일
Widen your initguess to be a vector of length 3 instead of a vector of length 2.
  댓글 수: 4
Walter Roberson
Walter Roberson 2021년 4월 26일
initguess = [1.6, 3.8, -1.2] + rand(1,3)
or similar. The [1.6, 3.8, -1.2] part should be the initial point that you want to choose random points "near". The rand(1,3) should be designed to move meaningfully around the range -- so in some cases you might come out with something like
initguess = [1.6, 3.8, -1.2] + randn(1,3) * 5;
To emphasize, the [1.6, 3.8, -1.2] are purely example values to show you how it is done. The (1,3) on the other hand is the size of the random number to be generated, 1 row and 3 columns.
Josiah Jarenee Comia
Josiah Jarenee Comia 2021년 4월 26일
I understand it more clearly now. Thank you sir!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Nonlinear Optimization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by