least_squares
Synopsis
fit a polynomial of specified order using the least squares method
Input Port
Parameters
Output Port
Description
least_squares fits a polynomial of a given order to an input data set. The input consist of (x,_y) pairs, where the X's are the 1D mesh coordinates of the nodes, and the Y's are the node_data values. These points are fit to a polynomial of the desired degree. Two outputs are produced; out_coeff is an array containing the n+1 coefficients of the resulting polynomial, and out_fld is the fit Y values computed by evaluating the polynomial at each X point.
Input
A port to connect to a user interface object that contains the module's widgets. By default, it is connected to the default user interface object in the application in which the macro is instanced. (This default connection is not drawn.)
Parameters
Output Port
double[order+1]. The coefficients of the resulting polynomial, in order from least significant (constant term) to most significant (highest power).
Example
File
See also related modules