Skip to content

Instantly share code, notes, and snippets.

@shane5ul
Last active December 20, 2015 23:29
Show Gist options
  • Save shane5ul/6212845 to your computer and use it in GitHub Desktop.
Save shane5ul/6212845 to your computer and use it in GitHub Desktop.
write to files with variable filename
filename = sprintf('file%04d.txt',i) % say i = 10
f1 = fopen(filename, 'w')
% write stuff to the file, ex: fprintf(f1,"%d",25)
fclose(f1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment