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!