CLsqFit:GetRejSigmaLow CLsqFit:GetSampleMean

CLsqFit:GetRetCode


The GetRetCode method returns a numeric code that identifies the status of the least squares fit. If a value other than 1 is returned, use GetErrMsg to obtain the error information. In general the return code will be less than 0 if an error occurred.

Syntax

nRetCode = CLsqFit:GetRetCode()

bullet.gif    nRetCode is a number corresponding to the status of the fit.

Example

The following script configures the fit but forgets to add any data points. After the fit fails, the script prints an error message and exits.

local L = new_lsqfit()

-- create a CLsqFit object

L:SetNumCoefs( 2 )

-- specify the number of coefficients

-- example: you forgot to add points to the fit

 

bSuccess = L:Fit()

-- do the fit

if not bSuccess then

-- test whether the fit succeeded

  local nErr = L:GetRetCode()

-- get the error code

  if nErr ~= 1 then

 

    local s = L:GetErrMsg()

-- get the error message

    Exit( Sprintf("Error[%d] %s\n", nErr, s ) )

-- exit the script and list the message

  end

 

end

 

Related Topics

CLsqFit class

GetRetCode

GetErrMsg

DoFit

Sprintf

 


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