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 following fourmex-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 MATLAB_VERSION R13 ( or R12.1 )
UNIX> setenv MATLABPATH $NETSOLVE_ROOT/bin/$NETSOLVE_ARCH/MATLAB/$MATLAB_VERSION
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 how to call the four new functions from Matlab: netsolve(), netsolve_nb(), netsolve_err(), and netsolve_errmsg().