MATLAB is quite fast at vectorised and matrix operations. For things that are slow you can write your own C/C++ function and call it from within MATLAB.