Postgres View Function Matlab