fprintf: writing text lists to .txt files
Afficher commentaires plus anciens
I need some help exporting some text lists in cell arrays to .txt functions. I have a list of names in an n x 1 array, called 'assets'. I would like to export it to a .txt file ('assets.txt'). My code currently states:
fid = fopen('assets.txt', 'w');
for row = 1:length(assets)
fprintf(fid, '%s\n', assets(row));
end
fclose(fid)
I get this error message: "Function is not defined for 'cell' inputs." What am I doing wrong?
Réponse acceptée
Plus de réponses (2)
Grzegorz Knor
le 28 Oct 2011
Probably:
fprintf(fid, '%s\n', assets{row});
William
le 28 Oct 2011
0 votes
Catégories
En savoir plus sur Standard File Formats dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!