Passing coefficients in array to cfit
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!!
Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!