%printfile(text, filename)

function printfile(text, filename)

fid = fopen(filename, 'w');
fprintf(fid,text);
fclose(fid);
