Main Content

AccelerateMATLABAlgorithms

For many applications, you can generate MEX functions to accelerate MATLAB®algorithms. If you have a Fixed-Point Designer™ license, you can generate MEX functions to accelerate fixed-point MATLAB algorithms. After generating a MEX function, test it in MATLAB to verify that its operation is functionally equivalent to the original MATLAB algorithm. Then compare the speed of execution of the MEX function with that of the MATLAB algorithm. If the MEX function speed is not sufficiently fast, you might improve it using one of the following methods:

  • Choosing a different C/C++ compiler.

    It is important that you use a C/C++ compiler that is designed to generate high performance code.

    Note

    The default MATLAB compiler for Windows®64-bit platforms,lcc, is designed to generate code quickly. It is not designed to generate high performance code.

  • 修改为加速度MATLAB代码

  • Control Run-Time Checks