Added some matlab functions