In /usr/share/local/matlab42/extern

/include

/lib

/src

In /usr/share/local/matlab42/extern/include

cmex.h
CMEX.H - Include file for C-language MEX-files built under MATLAB
3.5 or earlier.

By: Martin Knapp-Cordes
Date: Feb 92 - 24
Dec 92 - 23

Copyright (c) 1992 The MathWorks, Inc.
All rights Reserved

Note(s): 1. This file allows a user to compile without change
MEX files built to run under earlier versions of MATLAB

engine.h
@(#)engine.h generated by: makeheader Tue Jan 18 17:41:39 1994

built from:
/rel/test42/bld/u0/extern/../matlab/sun4.ansi/src/extern/engintrf.c

fintrf.h
fintrf.h - MATLAB/FORTRAN interface header file. This file
contains the declaration of the pointer type needed
by the MATLAB/FORTRAN interface.

Copyright (c) 1993-94 by The MathWorks, Inc.
Revision: 1.3 Date: 1994/02/02 23:10:54

mat.h
@(#)mat.h generated by: makeheader Tue Jan 18 17:41:38 1994

built from:
/rel/test42/bld/u0/extern/../matlab/sun4.ansi/src/file/matintrf.c

matrix.h
@(#)matrix.h generated by: makeheader Tue Jan 18 17:41:35 1994

built from:
/rel/test42/bld/u0/extern/../matlab/sun4.ansi/src/include/mathwork.h
/rel/test42/bld/u0/extern/../matlab/sun4.ansi/src/cmex/cmxcbk.c

mex.h
@(#)mex.h generated by: makeheader Tue Jan 18 17:41:36 1994

built from:
/rel/test42/bld/u0/extern/../matlab/sun4.ansi/src/cmex/cmex1.c
/rel/test42/bld/u0/extern/../matlab/sun4.ansi/src/fmex/fmex.c

simulink.h
SIMULINK.H - Include file for making MEX-file systems and blocks

This file should be included at the end of a MEX-file system.
It performs an interface to the MEX-file mechanism which allows
blocks and systems to be entered only as their corresponding
mathematical functions.

This template performs all checks for sizes of paramaters.
If you need to pass down variables from the workspace which
cause the system sizes to be variable then use the
define NCOEFFS. (For example, see stspace.c).


Syntax of MEX-file S-function:

[sys, x0] = filename(t,x,u,flag)

Andrew Grace Oct 11, 1990
Revised ACWG 1-10-91
Copyright (c) 1990-93 The Mathworks, Inc.
All Rights Reserved

simulink2.h
SIMULINK2.H - Include file for making MEX-file systems and blocks
with variables passed down from the workspace.

This file should be included at the end of a MEX-file system.
It performs an interface to the MEX-file mechanism which allows
blocks and systems to be entered only as their corresponding
mathematical functions.

This template performs all checks for sizes of paramaters.
With this include file you can pass down parameters from the
workspace to the system. (See for example stspace.c ).


Syntax of MEX-file S-function:

[sys, x0] = filename(t,x,u,flag)

Andrew Grace Oct 11, 1990
Copyright (c) 1990-93 The Mathworks, Inc.
All Rights Reserved

In /usr/share/local/matlab42/extern/lib

/sol2

/sun4

In /usr/share/local/matlab42/extern/lib/sol2

libmat.a

mexdb.o

In /usr/share/local/matlab42/extern/lib/sun4

fmex35.o

libmat.a

libmex.a

mexdb.o

In /usr/share/local/matlab42/extern/src

F2f
Name:

F2f preprocess Fortran file with C includes

Usage:

F2f [-h|-help] | [-r matlab_root] file.F . . .

Description:

This Bourne Shell script takes .F files with 'pointer' statements
and creates new .f files with the 'pointer' statements replaced by
the Fortran type statements appropriate for the platforms that
can't use .F files directly.

The platforms affected are:

ibm_rs (RS/6000), c2mp (convex), cray

For other platforms a diagnostic message is printed and no
.f files are created.

IMPORTANT: The path to the MATLAB root directory MUST be defined for
this script to work properly.

Options:

h - help. Print usage.

r - specify the path of the MATLAB root directory

Example:

The following command will create yprime.f and yprimeg.f with
the pointer statements replaced.

F2f -r /usr/local/matlab yprime.F yprimeg.F

File:

$MATLAB/extern/include/fintrf.h Header file with macros for
pointer statement.
$MATLAB/extern/src/F2f The location of this script.

Copyright (c) 1993-94 by The MathWorks, Inc.
Revision: 1.13 Date: 1994/03/15 21:04:07

README
Release Notes for extern/src files for Matlab 4.2

bf2f
Name:

bf2f script to create .f files from .F files

Usage:

bf2f [-h|-help] | file.F . . .

Description:

This Bourne Shell script takes .F files with 'pointer' statements
and creates new .f files with the 'pointer' statements replaced by
the Fortran type statements appropriate for the platforms and
removing any C preprocessing statements that start with #.

Options:

h - help. Print usage.

Example:

The following command will create yprime.f and yprimeg.f with
the pointer statements replaced.

bf2f yprime.F yprimeg.F

Copyright (c) 1994 by The MathWorks, Inc.
Revision: 1.4 Date: 1994/04/01 13:33:21

engtest1.F/engtest1.c
ENGTEST1

Simple program that illustrates how to call the Engine Library
from a C/Fortran program.

The example starts a MATLAB engine process,
sends a 3-by-2 real matrix to it, computes the eigen values of
the matrix multiplied by its transpose, gets the matrix back
to the Fortran program, and prints out the second eigenvalue.

engtest2.F/engtest.c
ENGTEST2

Simple program that illustrates how to call the Engine Library
from a C/Fortran program.

The example starts a MATLAB engine on a machine that you are
currently logged into.

engtest3.F/engtest3.c
ENGTEST3

Simple program that illustrates how to call the Engine Library
from a C/Fortran program.

The example starts a MATLAB engine, sends a simple matrix to
the engine, computes its eigenvalues, gets back the vector
containing the eigenvalues, and prints the second eigenvalue.

mattest.c
Mat-file test program

mattest1.F/mattest1.c
MATTEST1

Simple program that illustrates how to call the MAT-file Library
from a C/Fortran program.

The example writes a simple 3-by-2 real matrix into a MAT-file.
The matrix is named, 'A', and the MAT-file is named, 'foo.mat'.

mattest2.F/mattest2.c
MATTEST2

Simple program that illustrates how to call the MAT-file Library
from a C/Fortran program.

The example reads a matrix into a double array.
The matrix is named, 'A', and the MAT-file is named, 'foo.mat'.

mattest3.F/mattest3.c
MATTEST3

Simple program that illustrates how to call the MAT-file Library
from a C/Fortran program.

The example prints out the row dimensions of all the Matrices in
a MAT-file.

mattest4.F/mattest4.c
MATTEST4

Simple program that illustrates how to call the MAT-file Library
from a C/Fortran program.

The example reads the Matrix 'A' from one MAT-file and writes it
out to another.

mattest5.F/mattest5.c
MATTEST5

Simple program that illustrates how to call the MAT-file Library
from a C/Fortran program.

The example writes a simple 3-by-2 real matrix into a MAT-file.
The matrix is named, 'A', and the MAT-file is named, 'foo.mat'.

mattest6.F/mattest6.c
MATTEST6

Simple program that illustrates how to call the MAT-file Library
from a C/Fortran program.

The example writes the string, 'Hello, world', into a MAT-file.
The matrix is named, 'A', and the MAT-file is named, 'foo.mat'.

mattest7.F/mattest7.c
MATTEST7

Simple program that illustrates how to call the MAT-file Library
from a C/Fortran program.

The example prints out a directory of the Matrix names contained
within a MAT-file.

mexmat.c
mexmat.c MEX MAT-File Test Program

mextest1.F/mextst1.c
MEXTST1

MATLAB's MEX-file facility lets you call your own C/Fortran subroutines
directly from MATLAB. Conversely, it is also possible to call
internal MATLAB routines from your C/Fortran routines, using the special
mexCallMATLAB utility routine. In the way of an example, we've put together
this subroutine, MEXTEST1.C/MEXTST1.F, together with its gateway routine,
MEXTST1G.F(Fortran only).

This routine first forms and displays the matrix (in MATLAB notation):

hankel(1:4,4:-1:1) + sqrt(-1)*toeplitz(1:4,1:4)

Next it finds the eigenvalues and eigenvectors (using the
MATLAB function EIG), and displays the eigenvalue matrix. Then it
calculates the inverse of the eigenvalues to demonstrate manipulation
of MATLAB results and how to deal with complex arithemetic. Finally,
the program displays the inverse values.

Author: L. Shure 3-15-88
Copyright 1988, The MathWorks, Inc., All rights reserved.

mextst1g.F
MEXTST1G

MATLAB's MEX-file facility lets you call your own Fortran subroutines
directly from MATLAB. Conversely, it is also possible to call
internal MATLAB routines from your Fortran routines, using the special
mexCallMATLAB utility routine. In the way of an example, we've put together
the subroutine, MEXTST1.F, together with this gateway routine, MEXTST1G.f.

This is the gateway subroutine for linking in our EIGS example. To
use MATLAB as a subroutine library, a program must be linked in as
a MEX-file with MATLAB. For our EIGS example, we would invoke MATLAB
and execute the command 'EIGS'. This transfers control to the EIGS
program, which can then make calls to MATLAB's internal functions.

Since our program EIGS is stand-alone - it doesn't take arguments from
MATLAB - the gateway routine doesn't do anything; it just branches to the EIG
subroutine.

yprime.F
YPRIME The actual YPIME subroutine in FORTRAN/C

yprime.c/yprime.cc
YPRIME.CC Sample .MEX file corresponding to YPRIME.M
Solves simple 3 body orbit problem

The calling syntax is:

[yp] = yprime(t, y)


Marc Ullman June 22, 1987
Copyright (c) 1987 The Mathworks, Inc.
All Rights Reserved

yprime.m
YPRIME.M

Differential equation system for restricted three body problem.
Think of a small third body in orbit about the earth and moon.
The coordinate system moves with the earth-moon system.
The 1-axis goes through the earth and the moon.
The 2-axis is perpendicular, in the plane of motion of the third body.
The origin is at the center of gravity of the two heavy bodies.
Let mu = the ratio of the mass of the moon to the mass of the earth.
The earth is located at (-mu,0) and the moon at (1-mu,0).
y(1) and y(3) = coordinates of the third body.
y(2) and y(4) = velocity of the third body.

yprimeg.F
YPRIMEG.FOR - Gateway function for YPRIME.FOR

This is an example of the FORTRAN code required for interfacing
a .MEX file to MATLAB.

This subroutine is the main gateway to MATLAB. When a MEX function
is executed MATLAB calls the USRFCN subroutine in the corresponding
MEX file.

Compiled by Jerod M. Parker(jparker@bass.gmu.edu)

June 1994