function writefile(fn,m)
%WRITEFILE Writes a variable to a file.
%   writefile('enc.txt', 'ajdi aoij ofs') Writes the message in the second
%   argumenent to the file 'enc.txt'

fid = fopen(fn,'w');
fprintf(fid, '%s', m);
fclose(fid);