Matrix models for random partitions