My matlab helper functions.