MATLAB Runtime Server | ![]() ![]() |
Preparing the Example Files
The example consists of these nine files, located in the toolbox\runtime\examples\engineAPI
directory.
C File. Compile and link the C program, DrawApp.c
, which is in the directory toolbox\runtime\examples\engineAPI
. Keep the compiled file in the same directory.
For example, on Solaris machines, use these two commands at the system prompt.
setenv LD_LIBRARY_PATH matlabroot/extern/lib/sol2:$LD_LIBRARY_PATH cc -Imatlabroot/extern/include -o DrawApp DrawApp.c -Lmatlabroot/extern/lib/sol2 -leng -lmx
Here, matlabroot
is the directory in which MATLAB is installed.
As another example, on Windows NT 4.0 using Microsoft Visual C 6.0, execute the following commands at the MATLAB prompt.
opts = [matlabroot '\bin/win32\mexopts\msvc60engmatopts.bat']; out = [matlabroot '\toolbox\runtime\examples\engineAPI']; cfile = [matlabroot ... '\toolbox\runtime\examples\engineAPI\DrawAppWin.c']; mex('-f',opts,'-outdir',out,cfile);
MATLAB Startup Functions. Move matlabrt.m
and pathdefrt.m
into the toolbox\local
directory of your development copy of MATLAB, alongside the matlabrc.m
and pathdef.m
files.
MATLAB Application Files. To prepare to use these files, start MATLAB and execute this command.
Since the runtime P-files that you create will reside in the toolbox\runtime\examples\engineAPI
directory, it is important that this directory is either:
In this example, toolbox\runtime\examples\engineAPI
is the directory from which the C program will launch MATLAB.
On PC platforms, you should also modify the DOS path so that MATLAB can find all the files it needs. At the DOS prompt, type
where matlabroot
is the directory in which MATLAB is installed.
![]() | Engine API Example | Adapting the Design for Runtime Execution | ![]() |