MATLAB COM Builder    

Spectral Analysis Example

This example illustrates the creation of a comprehensive Excel add-in to perform spectral analysis. It requires knowledge of Visual Basic forms and controls, as well as Excel workbook events. See the VBA documentation for a complete discussion of these topics.

The example creates an Excel add-in that performs an FFT on an input data set located in a designated worksheet range. The function returns the FFT results, an array of frequency points, and the power spectral density of the input data. It places these results into ranges you indicate in the current worksheet. You can also optionally plot the power spectral density. You develop the function so that you can invoke it from the Excel Tools menu and can select input and output ranges through a GUI.

To create this add-in requires four basic steps:

  1. Build a stand-alone COM component from MATLAB code.
  2. Implement the necessary VBA code to collect input and dispatch the calls to your component.
  3. Create the GUI.
  4. Create an Excel add-in and package all necessary components for application deployment.

  Packaging the Component Building the Component