File Paths and Naming Conventions

Compile Path Search Order

Embedded MATLAB Coder resolves M-functions by searching first on the Embedded MATLAB path and then on the MATLAB path. See How the Embedded MATLAB Subset Resolves Function Calls in the Embedded MATLAB documentation.

Can I Add Files to the Embedded MATLAB Path?

With Embedded MATLAB Coder, you can prepend directories and files to the Embedded MATLAB path, as described in Adding Directories to Search Paths. By default, the Embedded MATLAB path contains the current directory and the Embedded MATLAB libraries.

When to Use the Embedded MATLAB Path

Use the Embedded MATLAB path to override a MATLAB function with a customized version. Because Embedded MATLAB Coder searches the Embedded MATLAB path first, an M-file on the Embedded MATLAB path always shadows an M-file of the same name on the MATLAB path. To override a MATLAB function with a version implemented in Embedded MATLAB libraries, follow these steps:

  1. Create each version of the M-function in identically-named M-files.

  2. Add the MATLAB version of the function to the MATLAB path.

  3. Add the Embedded MATLAB version of the function to the Embedded MATLAB path.

    See Adding Directories to Search Paths.

Adding Directories to Search Paths

The following table explains how to add directories to search paths:

To add directories to: Do this:
Embedded MATLAB pathPrepend directories to the Embedded MATLAB path using the compiler option -I. See -I Add Directories to Embedded MATLAB Path using emlc in the Real-Time Workshop Function Reference.
MATLAB pathFollow the instructions in Adding a Directory to the Search Path in the MATLAB Programming Fundamentals documentation.

Naming Conventions

Embedded MATLAB Coder enforces naming conventions for M-functions and generated files.

Reserved Prefixes

Embedded MATLAB Coder reserves the prefix eml for global C functions and variables in generated code. For example, Embedded MATLAB runtime library function names all begin with the prefix emlrt, such as emlrtCallMATLAB. To avoid naming conflicts, do not name C functions or primary M-functions with the prefix eml.

Conventions for Naming Generated files

The following table describes how Embedded MATLAB Coder names generated files. Embedded MATLAB Coder follows MATLAB conventions by providing platform-specific extensions for C MEX files.

PlatformMEX File ExtensionReal-Time Workshop Library ExtensionReal-Time Workshop Executable Extension
Linus Torvalds' Linux (32-bit).mexglx.aNone
Linux x86-64.mexa64.aNone
MicrosoftWindows (32-bit).mexw32.lib.exe
Windows x64.mexw64.lib.exe

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS