Function Writing to a text file
Afficher commentaires plus anciens
I am using a function to produce a madlib in a sense and it has to print to the command window and save to a text file. It prints fine to the command window but isn't saving to the text file and no error is showing up. This is what I have so far.
%open file to save to
fid=fopen('story1.txt','w');
%print to file and command window
fprintf(fid,'madlib',y)
fprintf(1,'madlib',y)
%close file
fclose(fid);
mad lib:this is actually a whole story but its very long
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Standard File Formats dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!