Matlab Madrigal API


The Matlab API described in this document has almost exactly the same functionality as the remote version, with two important differences:

Like all of Madrigal, the Matlab API is built on top of the the C API madrec, and the Fortran geo library. The Matlab Madrigal API consists of both MEX files written in C, and standard Matlab methods. Since Matlab is not open source, the Matlab API can only be installed successfully if Matlab is already installed.

This document describes a number of issues involving the installation and extension of the Madrigal Matlab API:

Configuring Matlab

When Madrigal is installed, the Madrigal Matlab API source files located in $MADROOT/source/madmatlab are compiled and installed in the directory $MADROOT/lib/madmatlab. To configure Matlab to search in this path, edit the file matlabroot/toolbox/local/pathdef.m, or consult your Matlab administration manual. If this is not done, individual users must run ">> addpath $MADROOT/lib/madmatlab". You will also need to edit the matlab script to add $MADROOT/lib to the environment variable LD_LIBRARY_PATH.

Manually installing Madrigal Matlab API

If you install Matlab after Madrigal, you'll need to manually install the Madrigal Matlab API:

Extending the Madrigal Matlab API

To add your own methods to the Madrigal Matlab API, write your methods as documented in the Matlab API manual in either C or Fortran, using any Madrigal method. Then edit the appropriate Makefile in $MADROOT/source/madmatlab to build your program, using isprint as a template. Manually install the Madrigal Matlab API as described above. You may also call the Madrigal Matlab API from any *.m file you write in Matlab.

If you feel your new method, written in Matlab, C, or Fortran, would be helpful to the whole Madrigal community, please feel free to contact us at openmadrigal-developers.


Revised: May 21, 2003