CLsqFit:UndeletePt


The UndeletePt method restores the status of a point that was deleted. The new status is "Use", meaning that the point will be used in subsequent fits.

Syntax

CLsqFit:UndeletePt( nIndex )

CLsqFit:UndeletePt( nIndex, nChannel )

where

    nIndex is the index of the point.

    nChannel is an optional parameter which specifies the channel of the point being restored. If omitted, all channels are restored.

  

This methods works like the SetPtStatus method with status = "Use" except that this method only restores the point if it was deleted. Points that are rejected are not restored. When a fit is run using Fit, all rejected points are initialized to "Use" status do they can participate in the data rejection process.

Example

The following example illustrates how to restore a delete point. In this case, the target point's index is found by matching its values:

L = CLsqFit:new()

-- 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

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()

-- Fit the line to remaining points

 

-- do something with the fit results

L:UndeletePt( n )

-- restore the point

L:Fit()

-- get a new fit result using the point

Related Topics

DeletePt

SetPtStatus

AddPt

CLsqFit class