| Embedded MATLAB™ | ![]() |
| On this page… |
|---|
Before performing code verification, The MathWorks recommends that you choose a debugging strategy for detecting and correcting noncompliant code in your MATLAB applications, especially if they consist of a large number of M-files that call each other's functions. Here are two best practices:
| Debugging Strategy | What to Do | Pros | Cons |
|---|---|---|---|
Bottom-up verification |
|
| Requires application tests that work from the bottom up |
Top-down verification |
| Lets you retain your top-level tests | Introduces extraneous code that you must remove after code verification, including:
|
Before you can successfully convert an M-file to a C-MEX function, you must verify that your M-code complies with Embedded MATLAB syntax and semantics, as defined in Working with the Embedded MATLAB Subset.
Embedded MATLAB MEX checks for all potential Embedded MATLAB syntax violations at compile time. When Embedded MATLAB MEX detects errors or warnings, it automatically generates a compilation report that describes the issues and provides links to the offending M-code. See Working with Compilation Reports.
If your M-code calls functions on the MATLAB path, Embedded MATLAB MEX attempts to compile these functions unless you declare them to be extrinsic (see How the Embedded MATLAB Subset Resolves Function Calls. To get detailed diagnostics, add the %#eml compiler directive to each external function that you want Embedded MATLAB MEX to compile, as described in Adding the Compilation Directive %#eml.
![]() | Setting Up File Infrastructure and Paths | Setting C-MEX Compilation Options | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |