MATLAB COM Builder    

Building the Component

Your component will have one class with two methods, computefft and plotfft. The computefft method computes the FFT and power spectral density of the input data and computes a vector of frequency points based on the length of the data entered and the sampling interval. The plotfft method performs the same operations as computefft, but also plots the input data and the power spectral density in a MATLAB figure window. The MATLAB code for these two methods resides in two M-files, computefft.m and plotfft.m.

To proceed with the actual building of the component, follow these steps:

  1. Start comtool. See Graphical User Interface Menus for a discussion of using comtool to build a COM component from a collection of MATLAB M-files.
  2. Create a new project with these settings:

Check Use Handle Graphics library.

See Project Settings for a description of new project settings.

  1. Add the computefft.m and plotfft.m M-files to the project.
  2. Save the project.
  3. Click Build to create the component.

  Spectral Analysis Example Integrating the Component with Visual Basic for Applications