Passing coefficients in array to cfit
3 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!