My code was originally developed in MATLAB and is vectorized
If that's the case, I would encourage you to use Octave's profiler and find out what your code is spending time on. It would be useful if you could to the same with Matlab's code profiler and find where the key differences are.