Postgres Max Function In Matlab