Interpolation is a process for estimating values that lie between known data points. It is important for applications such as signal and image processing and data visualization. MATLAB® interpolation functions let you balance the smoothness of data fit with execution speed and efficient memory use.
This example is included in the Spreadsheet Link™ EX product. To run it:
Start Excel®, Spreadsheet Link EX, and MATLAB sessions.
Navigate to the folder matlabroot\toolbox\exlink\.
Open the file ExliSamp.xls
Execute the example as needed.
This example uses a two-dimensional data-gridding interpolation function on thermodynamic data, where volume has been measured for time and temperature values. It finds the volume values underlying the two-dimensional, time-temperature function for a new set of time and temperature coordinates.
The example uses a Microsoft® Excel worksheet to organize and display the original data and the interpolated output data. You use Spreadsheet Link EX functions to copy the data to and from the MATLAB workspace, and then execute the MATLAB interpolation function. Finally, you invoke MATLAB graphics to display the interpolated data in a three-dimensional color surface.
Click the Sheet3 tab on ExliSamp.xls. The worksheet for this example appears.
The worksheet contains the measured thermodynamic data in cells A5:A29, B5:B29, and C5:C29. The time and temperature values for interpolation are in cells E7:E30 and F6:T6, respectively.
Make A34 the active cell. Press F2; then press Enter to execute the Spreadsheet Link EX function that copies the original time data to the MATLAB workspace. Move to cell A35 and execute the function to copy the original temperature data. Execute the function in cell A36 to copy the original volume data.
When you finish the example, close the figure window.