I have a vector of numbers that I would like to use to create a filename. For example with a vector  I would like the filename temp0001.file. This is simply done by
filename = sprintf('%04d', vector);
This doesn't carry over once I append more elemnts to the matrix, for example [1,2] should result in temp0012.file but instead becomes temp0102.file. Is there another way to parse the vectors?