| Contents | Index |
| On this page… |
|---|
When to Use the Code Generation Path Add Files to the Code Generation Path |
fiaccel resolves function calls by searching first on the code generation path and then on the MATLAB path. By default, fiaccel tries to compile and generate code for functions it finds on the path unless you explicitly declare the function to be extrinsic. An extrinsic function is a function on the MATLAB path that is dispatched to MATLAB software for execution. fiaccel does not compile extrinsic functions, but rather dispatches them to MATLAB for execution.
Use the code generation path to override a MATLAB function with a customized version. Because fiaccel searches the code generation path first, a MATLAB file on that path always shadows a MATLAB file of the same name on the MATLAB path.
To override a MATLAB function with a customized version:
Create each version of the MATLAB function in identically named files.
Add the MATLAB version to the MATLAB path.
Add the customized version to the code generation path.
With fiaccel, you can prepend folders and files to the code generation path, as described in Adding Folders to Search Paths. By default, the code generation path contains the current folder and the toolbox functions supported for code generation.
| To add folders to: | Do this: |
|---|---|
| Code generation path | Prepend folders to the code generation path by using the fiaccel-I option. |
| MATLAB path | Follow the instructions in Adding a Folder to the Search Path in the MATLAB Programming documentation. |
MATLAB enforces naming conventions for functions and generated files.
MATLAB reserves the prefix eml for global C functions and variables in generated code. For example, run-time library function names all begin with the prefix emlrt, such as emlrtCallMATLAB. To avoid naming conflicts, do not name C functions or primary MATLAB functions with the prefix eml.
MATLAB Coder software reserves certain words for its own use as keywords of the generated code language. MATLAB Coder keywords are reserved for use internal to MATLAB Coder software and should not be used in MATLAB code as identifiers or function names. C reserved keywords should also not be used in MATLAB code as identifiers or function names. If your MATLAB code contains any reserved keywords, the code generation build does not complete and an error message is displayed. To address this error, modify your code to use identifiers or names that are not reserved.
If you are generating C++ code using the MATLAB Coder software, in addition, your MATLAB code must not contain the C++ Reserved Keywords.
| auto | double | int | struct |
| break | else | long | switch |
| case | enum | register | typedef |
| char | extern | return | union |
| const | float | short | unsigned |
| continue | for | signed | void |
| default | goto | sizeof | volatile |
| do | if | static | while |
| catch | friend | protected | try |
| class | inline | public | typeid |
| const_cast | mutable | reinterpret_cast | typename |
| delete | namespace | static_cast | using |
| dynamic_cast | new | template | virtual |
| explicit | operator | this | wchar_t |
| export | private | throw |
Reserved Keywords for Code Generation.
| abs | fortran | localZCE | rtNaN |
| asm | HAVESTDIO | localZCSV | SeedFileBuffer |
| bool | id_t | matrix | SeedFileBufferLen |
| boolean_T | int_T | MODEL | single |
| byte_T | int8_T | MT | TID01EQ |
| char_T | int16_T | NCSTATES | time_T |
| cint8_T | int32_T | NULL | true |
| cint16_T | int64_T | NUMST | TRUE |
| cint32_T | INTEGER_CODE | pointer_T | uint_T |
| creal_T | LINK_DATA_BUFFER_SIZE | PROFILING_ENABLED | uint8_T |
| creal32_T | LINK_DATA_STREAM | PROFILING_NUM_SAMPLES | uint16_T |
| creal64_T | localB | real_T | uint32_T |
| cuint8_T | localC | real32_T | uint64_T |
| cuint16_T | localDWork | real64_T | UNUSED_PARAMETER |
| cuint32_T | localP | RT | USE_RTMODEL |
| ERT | localX | RT_MALLOC | VCAST_FLUSH_DATA |
| false | localXdis | rtInf | vector |
| FALSE | localXdot | rtMinusInf |
MATLAB provides platform-specific extensions for MEX files.
| Platform | MEX File Extension |
|---|---|
| Linux® (32-bit) | .mexglx |
| Linux x86-64 | .mexa64 |
| Windows (32-bit) | .mexw32 |
| Windows x64 | .mexw64 |
![]() | Using fiaccel | Preparing MATLAB Algorithms for Code Generation | ![]() |

Learn how to apply early verification to your development process through these technical resources.
How much time do you spend on testing to ensure implementation meets system-level requirements?
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |