필터 지우기
필터 지우기

fit type, automatic variable input

조회 수: 1 (최근 30일)
Manuel
Manuel 2012년 7월 24일
Hello,
I am using matlab for non linear fitting of nonlinear model parameters to data, with parameters constrains.
My model is something like this:
model(s1,sy,syD,su,ep,eu,b2,b3,slin,ey,b1,x)
where the first 11 arguments are paramenters and x is the variable
To fit the parameters I want to use:
mdl = @(s1,sy,syD,su,ep,eu,b2,b3,slin,ey,b1,x) model(s1,sy,syD,su,ep,eu,b2,b3,slin,ey,b1,x); fit_typ = fittype(mdl,'option',fit_opt); [Yfitt,gof,output]=fit(X,Y,fit_typ,'Start',p)
and is ok. But if I change the name of the parameter that I want to fit, I need to change it in the code manually.
Is there any way to automatically insert the parameter names from the input or a variable that I define at the beginning??
I have tryed something like:
a={s1,sy,syD,su,ep,eu,b2,b3,slin,ey,b1}
or
a={'s1','sy','syD','su','ep','eu','b2','b3','slin','ey','b1'}
and then
mdl = @(a,x)model(a,x); fit_typ = fittype(mdl,'option',fit_opt); [Yfitt,gof,output]=fit(X,Y,fit_typ,'Start',p)
But it doesn't work. Thank you very much in advance.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by