Example 1: A Simple 3rd Order Polynomial

Matlab Logo In this tutorial, you will learn how to perform a curve fit for nonlinear data using the lsqcurvefit command. This curve fit is performed by minimizing the sum of the error squared. This tutorial will go over two different examples. The first example involves a polynomial function, and the second example involves an asymptotic function. Let’s start with the first example, which consists of a 3rd degree polynomial. (Note: It’s possible to use the polyfit command, but we won’t be doing that here.)

The sample data for this example is shown in the scatter plot below. The goal is to fit the most accurate curve through these data points.

Sample Data

In this example we know beforehand what the model is, but sometimes you might not know this and you may have to propose your own model. This data is characterized by the following equation:

Polynomial Equation

Information we know: the x data and the y data.

Information we do NOT know and wish to find out: the parameters a, b, c, and d.

How can we go about finding this information? Continue onto the next section to find out.

Pages: 1 2 3