A gaussfit code gives an error of:
Error using nlinfit>checkWeights (line 961)
Weights must be a vector of real positive weights or a function handle that accepts a vector of
predicted response values and returns a vector of real positive weights the same size as Y.
Error in nlinfit (line 223)
nanweights = checkWeights(weights, yfit, y);
Error in Nonlinearhw (line 8)
plot(q,Astart,'-k'); [beta,R,J,covB]=nlinfit(q,A,'gaussfit',n,'Weights',dA);
Also q and A both are 161*1 matrixes.
What is the problem?? 🙁
Best Answer