fminsearch output function

조회 수: 1 (최근 30일)
minibela
minibela 2012년 5월 30일
Hi,
I'm using fminsearch in a function B that is called several times by another fminsearch in function A. In A I need to extract the information about the number of iterations, the minimum of the objective function, etc. for each call to fminsearch-B. I have created a structure to store that information but I don't know how to return it from B. I have thought to make use of 'OutputFcn' in fminsearch-B but it does not the job I need to be done. The output function must return only one logical value, 'stop'. Any idea about passing a function that may return something else?
Thank you,
minibela

답변 (1개)

minibela
minibela 2012년 5월 31일
Back with the answer.
My solution was to implement this code with nested functions. In function A I have defined a variable 'history'. I have changed the call to function B (which includes a second call to fminsearch) with a call to a nested function A2. In A2 I'm calling B and B feeds 'history ' (common to A and A2) with the information provided by the second fminsearch.
I'm open for a better approach.
minibela

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by