Origin Version (Select Help-->About Origin): 7.0 Operating System: windows 98 se
Hi,
I have a large number of curves that I would like to automate the fitting of with Origin C. I am trying to use the NLSF in Origin C to do this using the following code borrowed from an example somewhere: NLSFCntrl nlsfMyFit;// create NLSFcntrl - see OC_Types.h for details initNLSF(nlsfMyFit); // initialize structure with default initial values nlsfMyFit.imaxIter=1000; nlsfMyFit.pasteToPlot = true; nlsfMyFit.pasteToResults = true; lstrcpy(nlsfMyFit.szYdataName, strYDataName); // assign fit dataset name lstrcpy(nlsfMyFit.szFuncName, "lorentz"); // assign fitting function name fitNLSF(nlsfMyFit);
The problem is that when I ask for the Results (i.e. the first parameter using nlsfMyFit.Par[1]) it returns the initialization parameters whereas the results. Can someone help me?
I think NLSFCntrl is an older method that was developed before LabTalk object access was greatly improved in Origin C. Perhaps you might prefer the following in Origin C.
// After this line you should be able to directly use the LabTalk // NLSF object in Origin C using NLSF = LabTalk.NLSF; NLSF.maxIter = 1000; // etc.
Hope this helps.
Gary OriginLab
P.S. As Mike said I would first get the latest patch.