
Using the data set above, determine the relationship between velocity and time.
First, let us input the variables (Workspace > New variable) as shown in the following figures.


Second, we will plot the data by typing in plot(time,velocity) at the MATLAB prompt. The following plot is generated, select Tools > Basic Fitting:

In the "Basic Fitting" window, select "linear" and "Show equations". The best fitting linear line along with the corresponding equation are displayed on the plot:

Now let us do another curve fitting and obtain an equation for the function. Using that equation, we can evaluate the function at a desired value with polyval.
- 瀏覽次數:1648