It is sometimes useful to access your own C or Fortran programs
using shell escape functions. Shell escape
functions use the shell escape command
! to make
external stand-alone programs act like new MATLAB® functions.
For example, the following function,
uses an external function,
gareqn, to find the
solution to Garfield's equation.
function y = garfield(a,b,q,r) save gardata a b q r !gareqn load gardata
Saves the input arguments
r to a MAT-file in the workspace using the
Uses the shell escape operator to
access a C or Fortran program called
uses the workspace variables to perform its computation.
its results to the
to obtain the results.
For more information, see Run External Commands, Scripts, and Programs.