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