What are you expecting to see with this example? You are appending an empty matrix, so it would be impossible to tell if it has done what you want or not.
Also, what is wrtiefile? That does not appear to be a MATLAB function. However, for this example, you should use dlmwrite. It doesn't make sense to use two different write commands.
On that note, notice that the documentaiton now gives the following warning:
dlmwrite is not recommended. Use writematrix instead. For more information, see Compatibility Considerations.