Passing coefficients in array to cfit
이전 댓글 표시
Hey,
I am trying to pass coefficient values to cfit in an array. It stops with an error complaining that there are not enough parameters for the model.
for i=1:(numGauss+numLorentz), start_amp(i) = 1; start_Bres(i) = 3450; start_lwpp(i) = 10; end
start_param=[start_amp start_Bres start_lwpp];
cfitfunc_GL=cfit(model_GL,start_param);
if I do instead this (numGauss=1; numLorentz=0):
cfitfunc_GL=cfit(model_GL,start_amp(1), start_Bres(1), start_lwpp(1));
it works.
Is it not allowed to pass all the coefficients in an array or do I miss something else here?
Thanks a lot for your help!!
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!