General matlab functions used by other projects