Test the output of generated code by using MATLAB® unit tests with MATLAB® Coder™.
Test external C code by using MATLAB® unit tests with MATLAB® Coder™.
Use the ConstantInputs parameter to control whether a MEX function checks the value of a constant input argument.
Configure the build for external C/C++ code from within a MATLAB® function. Configure the build within a function so that you can more easily integrate it with other projects.
Integrate a simple C function with MATLAB® code by using coder.ceval. Consider the MATLAB function, mathOps:
Call a C function that uses data types that are not natively defined within MATLAB®.
Register and use a Microsoft® Visual C/C++ (MSVC) toolchain running on a 64-bit Windows® platform to compile a 32-bit dynamic link library (DLL). This example uses a Microsoft® compiler.
Generate a standalone C library from MATLAB code that implements a simple Sobel filter that performs edge detection on images. The example also shows how to generate and test a MEX function in
Generate a standalone C library from MATLAB code that reads a file from disk using the functions fopen/fread/fclose.
Register and use a toolchain to compile an executable. This example uses Intel® Compiler, but the concepts and API shown below can be used for any toolchain. The registered toolchain can be
Generate a MEX function and C source code from MATLAB code that performs portfolio optimization using the Black Litterman approach.
Generate C code for a MATLAB Kalman filter function, kalmanfilter , which estimates the position of a moving object based on past noisy measurements. It also shows how to generate a MEX