my commonly used matlab function