Here's a function that does what you want in one go. It creates the empty matrix (rows and columns as provided by the first parameter Size), and puts each of the elements of the provided matrix (second parameter Data) on the respective column and row node positions (as specified by the third and fourth parameters Cnodes and Rnodes respectively). 
You'll have to type the function in Prime yourself, since I'm limited to Prime express.
But I can view your Prime sheets, so if you need more help, just come back here.
Success!
Luc