There are several ways to accelerate MATLAB algorithms and applications. The optimal approach depends on your programming expertise, the type of algorithms you wish to accelerate, and the hardware available to you.
It’s a good practice to optimize your serial code for performance before considering other approaches. Two effective programming techniques for MATLAB acceleration are preallocation and vectorization.
MATLAB and related toolboxes have already been optimized for performance. For example, System objects are object-oriented implementations of MATLAB algorithms that can accelerate MATLAB code, particularly for signal processing and communications applications.
Multicore CPUs, GPUs, and clusters can accelerate MATLAB code. High-level parallel constructs in Parallel Computing Toolbox let you take advantage of high-performance hardware with minimal programming effort. The toolbox also enables the parallel computing support found in many functions and algorithms in MATLAB products.
To accelerate some MATLAB algorithms, you can generate readable and portable C code and compile it into a MATLAB executable. Much of the MATLAB language and several toolboxes support code generation through MATLAB Coder.
For some applications, you can combine these methods for additional MATLAB acceleration.
See also: Parallel Computing Toolbox, MATLAB Distributed Computing Server, MATLAB Coder, DSP System Toolbox, Communications System Toolbox, MATLAB multicore, MATLAB GPU computing, parallel computing, Distributed Computing on the Cloud with MATLAB