How to remove the data-type error in lsqcurvefit ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello,
I am using MATLAB version R2006b.
I have a doubt in the optimization function "LSQCURVEFIT".
I have written the argument in command window as:
S = lsqcurvefit(@optim, kro, Cdata, ydata)
where "S" is a optim function input argument variable as:
function F = optim(S,Cdata);
Please note that both Cdata and ydata that I am supplying are double type arrays.
When I am running the lsqcurvefit command in command window the error that is coming is:
**LSQCURVEFIT cannot continue because user supplied objective function failed with the following error: Undefined function or method 'S' for input arguments of type 'double'.
Error in ==> lsqcurvefit at 182 [x,Resnorm,FVAL,EXITFLAG,OUTPUT,LAMBDA,JACOB] = ...**
Please help how should I resolve this issue ?
Akzeptierte Antwort
Laura Proctor
am 24 Dez. 2012
It looks like the issue might be in the optim function in the use of the input variable S. Can you make a simple call to optim without receiving the error?
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Nonlinear Least Squares (Curve Fitting) finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!