the estimated temperatures are 64, 65.5, and 68. at each location are 53,56, and 57.5☏, respectively. Th~s the estimated temperatures at 8 A.M. The following session produces an estimate of the temperatures at 8 A.M. We define x as before, but now we define y to be a matrix whose three columns contain the second, third, and fourth columns of the preceding table. For example, suppose we now have temperature measurements at three locations and that the measurements at 8 A.M. and 10 A.M. The interp1 function can be used to interpolate in a table of values by defining y to be a matrix instead of a vector. Thus we cannot use the interp1 function to estimate the temperature. The values of the independent variable in the vector x must be in ascending order and the values in the interpolation vector x_int must lie within the range of the values in X. You must keep in mind two restrictions when using the interp1 function. The vectors x and y contain the times and temperatures, respectively. Produces a vector the same size as x_int containing the interpolated values of y that correspond to x_into For example, the following session produces an estimate of the temperatures at 8 A.M. 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) Figure 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. 12 noon Temperature (✯) 49 57 71 75Ī plot of this data is shown in Figure 7.4-1 with the data points connected by, dashed lines. are missing for some reason, perhaps because of equipment malfunction. 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. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |