CLsqFit:DeletePt


The DeletePt method sets the status of an existing point to "Del", meaning that the point is deleted and will not be used in the fit. You can later restore the point using the UndeletePt method.

Syntax

CLsqFit:DeletePt( nIndex )

CLsqFit:DeletePt( nIndex, nChannel )

bullet.gif    nIndex is the index of the point.

bullet.gif    nChannel is an optional parameter which specifies the channel to delete. If omitted, all channels are deleted.

Examples

The following example illustrates how to change the weight of an existing point. In this case, the target point's index is found by matching its values:

L = new_lsqfit()

-- create a CLsqFit object

L:SetNumCoefs( 2 )

-- set 2 coefficients

L:AddPt( 3.5, 5.15 )

-- add a point for x = 3.5 and y = 5.15

-- add more points to the fit

 

L:Fit()

-- Fit the line to all points

-- do something with the fit results

 

n = L:FindPt( 3.5, 5.15 )

-- find the point (if we don't know it has index 1)

L:DeletePt( n )

-- delete the point

L:Fit()

-- get a new fit result without the point

Related Topics

CLsqFit class, UndeletePt, SetPtStatus, AddPt


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.