MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Manual de usuario Pagina 15

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 408
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 14
Introducing MEX-Files
1-3
Introducing MEX-Files
You can call your own C or Fortran subroutines from MATLAB as if they were
built-in functions. MATLAB callable C and Fortran programs are referred to
as MEX-files. MEX-files are dynamically linked subroutines that the MATLAB
interpreter can automatically load and execute.
MEX-files have several applications:
Large pre-existing C and Fortran programs can be called from MATLAB
without having to be rewritten as M-files.
Bottleneck computations (usually
for-loops) that do not run fast enough in
MATLAB can be recoded in C or Fortran for efficiency.
MEX-files are not appropriate for all applications. MATLAB is a
high-productivity system whose specialty is eliminating time-consuming,
low-level programming in compiled languages like Fortran or C. In general,
most programming should be done in MATLAB. Don’t use the MEX facility
unless your application requires it.
Using MEX-Files
MEX-files are subroutines produced from C or Fortran source code. They
behave just like M-files and built-in functions. While M-files have a
platform-independent extension,
.m, MATLAB identifies MEX-files by
platform-specific extensions. This table lists the platform-specific extensions
for MEX-files.
Table 1-1: MEX-File Extensions
Platform MEX-File Extension
Alpha
mexaxp
HP, version 10.20
mexhp7
HP, version 11.x
mexhpux
IBM RS/6000
mexrs6
Linux
mexglx
SGI, SGI64
mexsg
Vista de pagina 14
1 2 ... 10 11 12 13 14 15 16 17 18 19 20 ... 407 408

Comentarios a estos manuales

Sin comentarios