MATLAB N-dimensional sparse matrix implementation