MATLAB: Save as .txt file

savetxt file

hello, filename =strcat('directory',int2str(v),'.txt'); save ( filename,'im') can I know why I used this script, the .txt file cannot be read.fyi, I used loop and put the script inside the loop. Actually the .txt file should read a number. Can someone correct my coding.Thanks!-_-

Best Answer

When you want to save as a text file, use the save() -ascii flag
save ( filename,'im', '-ascii')
Related Question