CLsqFit:new
The new method constructs a new instance of a CLsqFit object. You must call this method before using the class.
L = CLsqFit:new() where |
L is a new CLsqFit object with all properties initialized to default values.
The CLsqFit object is initialized with the following default properties:
n-dimensional polynomial basis function selected. See SetBasisFunc.
1 data channel. See SetNumChannels.
0 coefficients specified. See SetNumCoefs.
0 sample points added. See AddPt and AddPtWt.
The following script creates a CLsqFit object, specifies a line is to be fit using 2 coefficients, adds data and does a fit. The CLsqFit object is deleted when done in order to conserve memory use.
|
-- create a CLsqFit object |
|
-- set 2 coefficients |
|
-- add a point for x = 3.5, y = 5.15 |
|
-- add a point |
|
-- add a point |
|
-- Fit the line |
|
-- do something with the results |
|
-- best delete from memory when you are finished |