Finds the coefficients slope and intercept, using the least-squares solution, which describe the line that best represents the set of input data points.

This VI is a subVI of the Linear Fit PtByPt VI. The Linear Fit Coefficients PtByPt VI is similar to the Linear Fit Coefficients VI.

Note By default, reentrant execution is enabled in all Point By Point VIs.


icon

Inputs/Outputs

  • cbool.png initialize

    initialize, when TRUE, initializes the internal state of the VI.

  • cdbl.png y

    y is an input data point.

  • cdbl.png x

    x is an input data point.

  • ci32.png sample length

    sample length is the length of each set of incoming data. The VI performs computation for each set of data. The default is 100.

    When you set sample length to zero, the VI calculates a cumulative solution for the input data from the time that you called or initialized the VI. When the sample length setting is greater than zero, the VI calculates the solution for only the newest set of input data.

  • i1ddbl.png History of x

    History of x is the set of input data points used to compute slope and intercept.

  • idbl.png slope

    slope returns the slope of the fitted model.

  • idbl.png intercept

    intercept returns the intercept of the fitted model.

  • ii32.png error

    error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.

  • i1ddbl.png History of y

    History of y is the set of input data points used to compute slope and intercept.