MathWorks interview question

How to speed up the matrix assembling process?