Suite of useful matlab functions