Chapter 6. Matlab Interface

Table of Contents
Introduction
What to Do First
Calling netsolve() to perform computation
Calling netsolve_nb()
What Can Go Wrong?
Catching NetSolve errors
Demo
Optional: Testing the NetSolve BLAS interfaces
Optional: Testing the NetSolve LAPACK interfaces
Optional: Testing the NetSolve ScaLAPACK interfaces
Optional: Testing the NetSolve 'sparse_iterative_solve' interface
Optional: Testing the NetSolve 'sparse_direct_solve' interface

Introduction

Building the Matlab interface by typing
UNIX> make matlab
in the directory $NETSOLVE_ROOT produces the four following mex-files :

$NETSOLVE_ROOT/bin/$NETSOLVE_ARCH/netsolve.mex###
$NETSOLVE_ROOT/bin/$NETSOLVE_ARCH/netsolve_nb.mex###
$NETSOLVE_ROOT/bin/$NETSOLVE_ARCH/netsolve_err.mex###
$NETSOLVE_ROOT/bin/$NETSOLVE_ARCH/netsolve_errmsg.mex###

The ### part of the extension depends on the architecture (for instance, the extension is .mexsol for the Solaris Operating System). These four files alone are the Matlab interface to NetSolve. To make these four files accessible to Matlab, the user must modify the MATLABPATH environment variable as:
UNIX> setenv MATLABPATH $NETSOLVE_ROOT/bin/$NETSOLVE_ARCH
It is also possible to use the Matlab command addpath. For more information about mex-files, the user can refer to [matlab]. In the following sections, the user will learn to call four new functions from Matlab: netsolve(), netsolve_nb(), netsolve_err(), and netsolve_errmsg().