필터 지우기
필터 지우기

lsqcurvefit.m ... how to find intermediate steps?

조회 수: 2 (최근 30일)
Michael
Michael 2012년 10월 31일
Hi
I'm fitting using lsqcurvefit and the OUTPUT structure tells me there are 4 steps with 20 function evaluations before the stopping criteria is reached. Is there any way to find the parameter values at each of these steps?
My goal is to plot each fit to demonstrate the improvement between model and data.
Regards, Michael
  댓글 수: 1
Michael
Michael 2012년 10월 31일
I'm trying to do this using output functions, but the form of the function seems very restrictive, and it doesn't allow me to store the intermediate values in some pre-allocated matrix. All I can do is print the output, which means everything from that point on must be done manually... any help?

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

답변 (2개)

Sean de Wolski
Sean de Wolski 2012년 10월 31일
You could have your objective function print to a text file explicitly or keep a persistent variable around that stores the intermediate steps.
  댓글 수: 4
Matt J
Matt J 2012년 10월 31일
편집: Matt J 2012년 10월 31일
His post says that there are 4 "steps" (I assume that means iterations) and 20 function evaluations, and that he wants the parameter values at each of the "steps", not at each function evaluation.
Sean de Wolski
Sean de Wolski 2012년 10월 31일
Ahh.. quite possibly, yeah.

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


Matt J
Matt J 2012년 10월 31일
편집: Matt J 2012년 10월 31일
No, it's not true that you can't store intermediate output to a matrix using an OutputFcn. The following example shows how to do this

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by