Create nanmax function to imitate max function, but return nan when array is empty.
Create nanmin function.