Postgres Aggregate Into Arraylist Length Function Matlab