Initial commit of matlab version