필터 지우기
필터 지우기

How can I obtain the parameters estimated in every iteration of lsqcurvefit?

조회 수: 4 (최근 30일)
nt_ba
nt_ba 2017년 2월 3일
답변: Alan Weiss 2017년 2월 6일
x = lsqcurvefit(fun,x0,xdata,ydata)
Lsqcurvefit starts at x0 (initial guess) and finds coefficients x to best fit the nonlinear function fun(x,xdata) to the data ydata (in the least-squares sense). Then, it returns the final value(s) of x0 after all iterations are completed. Is it possible to get all the different values, from all iterations, of the initial guess until the solution is found?
Thanks in advance!

답변 (2개)

the cyclist
the cyclist 2017년 2월 3일
Did you try carefully reading the documentation for lsqcurvefit?
In the Input Arguments section, under options, the documentation explains how to display iteration-level details. That seems promising.
  댓글 수: 2
nt_ba
nt_ba 2017년 2월 3일
Thanks for your reply, but i want an iterative display of the values of x0. I don't think that's what is being explained in the Input Arguments section.
the cyclist
the cyclist 2017년 2월 4일
Hm. x0 is an input, so I am not sure what you are asking for. (Granted, I don't have experience using this particular function.)
If there are no output options that suit your needs, you could always copy the function to your own version (e.g. mylsqcurvefit), and edit it so that it outputs the things you need while it is executing.

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


Alan Weiss
Alan Weiss 2017년 2월 6일
Perhaps you could use an output function to give you the information you want.
Alan Weiss
MATLAB mathematical toolbox documentation

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by