Writing Strings to File in MATLAB

  • Context: MATLAB 
  • Thread starter Thread starter darthxepher
  • Start date Start date
  • Tags Tags
    File Matlab Writing
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 3K views
darthxepher
Messages
56
Reaction score
0
Hey,

so i want to write a string to a .txt file and I tried by doing this:

save filename.txt writer

(where writer is the variable containing string)
...
But i get weird char. instead of the string.
Any ideas?
 
Physics news on Phys.org
I solved it with a

fid = fopen(path,'wt');
fprintf(fid,writer);
fclose(fid);


:)