Subcategory: None · Core · Parallel computing toolbox

Preallocaton

When you grow an array dynamically inside a for loop, MATLAB must repeatedly allocate new memory and copy the existing contents. This can significantly degrade performance. Preallocating reserves sufficient contiguous memory upfront, avoiding costly resizing operations later.

Read More

Vectorisation

MATLAB is optimised to take advantage of vectorisation for mathematical operations between arrays, whereby the processor executes one instruction across multiple variables simultaneously. Vectorisation can perform mathematical operations many times faster than a for loop and even take advantage of conditional logic.

Read More

GPU Arrays

MATLAB makes it easy to run matrix operations on an NVIDIA GPU. There is a cost for moving data to and from the GPU, but if your entire algorithm can be done in matrix or vector operations, and your data is big enough, it can be faster.

Read More