Hello,
I have an issue using nlinfit in order to optimize the parameters of my model. My goal is to find the right parameters (in the vector beta) so my stochastic model fits my experimental data.
Here is my code :
function x = optim(n,Xdist,Ydist,kexp)
nbr = 100;
f=@(beta)model(beta,kexp,nbr,n)
beta0=[20,0.1,0.1]
nlinfit(Ydist,Xdist,f,beta0)
"model" returns the cumulative distribution function of my model and Xdist and Ydist stand for my experimental cumulative distribution function.
When I run it I get the error : "Error using nlinfit (line 205) Error evaluating model function '@(beta)model(beta,kexp,nbr,n)'.
Error in optim (line 10) nlinfit(Ydist,Xdist,f,beta0)
Caused by: Error using optim>@(beta)model(beta,kexp,nbr,n) Too many input arguments."
Do you know what I should change ?
Thanks for your help.

回答 (1 件)

Torsten
Torsten 2017 年 3 月 3 日

0 投票

f=@(beta,x)model(beta,x,kexp,nbr,n)
Best wishes
Torsten.

カテゴリ

ヘルプ センター および File Exchange で Programming についてさらに検索

質問済み:

2017 年 3 月 2 日

回答済み:

2017 年 3 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by