Matlab compatibility