MATLAB as an ActiveX Server from a Visual Basic Client

Here are the two Excel files with VB macros that call MATLAB as an ActiveX server. These are examples of using MATLAB as the flexible computation engine for on-line analysis. The file sine.xls uses MATLAB to calculate and plot a simple sine curve. This provides a very simple example of how MATLAB can be used as a computational engine from Excel or other VB Client.

The file plspred.xls can be used to make PLS predictions using a model developed in PLS_Toolbox. It has two worksheets: "From Sheet" does a prediction for the current column using the .mat file specified in cell A1 (the .mat file should contain a PLS structure output from MODLGUI named "model") "Real-Time" uses the .mat file model specified in cell A1 together with a .csv file named in cell A2 to simulate what an on-line predictor might look like. Click the "Sim. Real Time Pred" button to start the simulation running. It will read each line of the .csv file and do a prediction for the values therin and start over from the beginning when it reaches the end. Press [Esc] to stop it. The .csv and .mat files necessary to run the excel spreadsheets are also included. The full path-name for these files needs to be specified in the Excel spreadsheets (wherever you put them). Also included is the example m-file for trend charting. It is called by both plspred worksheets.

Download Excel_sheets.zip.