There are a few problems inside your loop. In each step you set m equal to zero and increment it to one. So m is not growing as it is intended to be. m=0 should be prior to the beginning of the loop. Furthermore, inside the loop you are using dlmwrite to write emag and t to text files, but emag is not changing inside the loop.
Basically, you are not writing anything because m never reaches 100. If you change this and m reaches 100, 200, ... then you are appending the same emag to the file.
Howerer, if you have some data in the variable myData, you can write every 100th value to a text file as follows:
myData = rand(1e6,1);
Edit: If you want to save the variable for further processing in matlab, than I would recommend to save the variable as mat-File instead of a text file. Mat-Files are compressed, a lot faster to write and read and I think you do not neccesseraly need to downsample your data. The one-liner
does the job. Be careful, that your variable names appear in appostrophes, i.e. as char array.