You can use the Fitting VIs to perform curve fitting analysis or regression.
The least squares method of curve fitting fits a curve to a particular data set. Equation A defines the least square error.
| e(a) = [f(x, a) – y(x)]2 | (A) |
where e(a) is the least square error, y(x) is the observed data set, f(x, a) is the functional description of the data set, and a is the set of curve coefficients that best describes the curve.
For example, if a = {a0, a1}, the following equation yields the functional description.
| f(x, a) = a0 + a1x | (B) |
The least squares algorithm finds a by solving the system defined by Equation C.
![]() |
(C) |
To solve the system defined by Equation C, you set up and solve the Jacobian system generated by expanding Equation C. After you solve the system for a, you can use the functional description f(x, a) to obtain an estimate of the observed data set for any value of x.
The Fitting VIs automatically set up and solve the Jacobian system and return the set of coefficients that best describes the data set. You can concentrate on the functional description of the data without having to solve the system in Equation C.
![]() |
Note You can use the Curve Fitting VIs only in the LabVIEW Full and Professional Development Systems. |
In some applications, parameters such as humidity, temperature, and pressure can affect data you collect. You can model the statistical data by performing regression analysis and gain insight into the parameters that affect the data.
The following figure shows the block diagram of a VI that uses the Linear Fit VI to fit a line to a set of data points.

You can modify the block diagram to fit exponential and polynomial curves by replacing the Linear Fit VI with the Exponential Fit VI or the General Polynomial Fit VI.
The following figure shows a multiplot graph of the result of fitting a line to a noisy data set.

The practical applications of curve fitting include the following applications: