![]() ![]() ![]() If x_int is a vector containing the value or values of the independent variable at which we wish to estimate the dependent variable, then typing interp1 (x,y, x_int)įigure 7.4-7 A plot of temperature data versus time Suppose that x is a vector containing the independent variable data and that y is a vector containing the dependent variable data. Linear interpolation in MATLAB is obtained with the interp1 and interp2 functions. Later in this section we use polynomial functions to do the interpolation, Using straight lines to connect the data points is the simplest form of interpolation. Another function could be used if we have a good reason to do so. Plotting the data sometimes helps to judge the accuracy of the interpolation. In general, the more closely spaced the data, the more accurate the interpolation. When using interpolation, we must always keep in mind that our results will be approximate and should be used with caution. Of course we have no reason to believe that the temperature follows the straight lines shown in the plot, and our estimate of 64☏ will most likely be incorrect, but it might be close enough to be useful. Linear interpolation is so named because it is equivalent to connecting the data points with a linear function (a straight line). We have just performed linear interpolation on the data to obtain an estimate of the missing data. From the plot wethus estimate the temperature at 8 A.M. If we need to estimate the temperature at 10 A.M., we can read the value from the dashed line that connects the data points at 9 A.M. are missing for some reason, perhaps because of equipment malfunction.Ī plot of this data is shown in Figure 7.4-1 with the data points connected by, dashed lines. Suppose we have the following temperature measurements, taken once an hour starting at 7:00 A.M. The data’s standard deviation indicates how much the data is spread around the aggregated point. You can use the methods of Sections 7.1 and 7.2 to aggregate the data by computing its mean. data have been aggregated if necessary, so only one value of y corresponds to a specific value of x. If we average the two results, the resulting data point will be x = 10V,y = 3.2 mA, which is an example of aggregating the data, In this section we assume that the. ![]() For example, suppose we apply 10 V to a resistor, and measure 3.1 mA of current. Then, repeating the experiment, suppose We measure 3.3 mA the second time. In other cases there will be several measured values of y for a particular value of x. In some applications the data set will contain only . Suppose that x represents the independent variable in the data (such as the applied voltage in the preceding example), and y represents the dependent variable (such as the resistor current). ![]() Such plots, some perhaps using logarithmic axes, often help to discover a functional description of the data. Interpolation and extrapolation are greatly aided by plotting the data. In other cases we might need to estimate the variable’s value outside of the given data range. This process is extrapolation. In some applications we want to estimate a variable’s value between the data points. Another type of paired data represents a profile, such as a road profile (which shows the height of the road along its length). For example, the paired data might represent a cause and effect, or input-output relationship, such as the current produced in a resistor as a result of an applied voltage, or a time history, such as the temperature of an object as a function of time. Engineering problems often require the analysis of data pairs. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |