Main Content

Verify MEX Functions in the MATLAB Coder App

In the MATLAB® Coder™ app, after you generate a MEX function, you can verify that the generated MEX function has the same functionality as the original MATLAB entry-point function. Provide a test file that calls the original MATLAB entry-point function. The test file can be a MATLAB function or script. The test file must be in the same folder as the original entry-point function.

  1. On the Generate Code page, click Verify Code.

  2. Type or select the test file name.

  3. To run the test file without replacing calls to the original MATLAB function with calls to the MEX function, for Run using, select MATLAB code. Click Run Generated Code.

  4. To run the test file, replacing calls to the original MATLAB function with calls to the MEX function, for Run using, select Generated code. Click Run Generated Code.

  5. Compare the results of running the original MATLAB function with the results of running the MEX function.

The MATLAB Coder app is not supported in MATLAB Online™. To verify MEX functions in MATLAB Online, see Verify MEX Functions at the Command Line.

See Also

|

Related Topics