Passing coefficients in array to cfit

3 views (last 30 days)
Benjamin
Benjamin on 24 Feb 2012
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 Programming 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!