Curve fitting in Matlab

Hi all
I am trying to do a curve fit following an example found on the net.
below is the code..Can someone explain the code below please.
especially A= params(1) and lamda=params(2) what are they doing (what is params?)
function sse=myfit(params,Input,Actual_Output)
A=params(1);
lamda=params(2);
Fitted_Curve=A.*exp(-lamda*Input);
Error_Vector=Fitted_Curve - Actual_Output;
it might be a stupid question but I just dont know

回答(1 个)

Doug Hull
Doug Hull 2012-8-24

0 个投票

params seems to be an input to the function. The code is pulling out specific values of that input and naming them something more intuitive.

类别

在 帮助中心 和 File Exchange 中查找有关 Get Started with Curve Fitting Toolbox 的更多信息

标签

提问:

2012-8-24

Community Treasure Hunt

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

Start Hunting!

Translated by