Matlab version of OTIS