new_lsqfit
The new_lsqfit is a non-class version of the CLsqFit:new method which creates and returns a newa CLsqFit object.
L = new_lsqfit()
L is returned as the new CLsqFit object.
On failure, nil is returned.
The new 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, adds some data, and performs a fit. Since SetBasisFunc is not used, a polynomial function is assumed.
|
-- create 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 |
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics,
Inc. All Rights Reserved.