save a m*n cell file as n text files
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Bhaskar panchireddi
le 2 Juin 2016
Commenté : Bhaskar panchireddi
le 2 Juin 2016
My matlab code is generating a cell of order 10000*100. I have to save all the columns of this cell in text format separately. I mean i should get 100 text files. what should i do? please help
Réponse acceptée
Ahmed Rashid
le 2 Juin 2016
a = rand(1000, 100);
for k = 1:100
fileID = fopen(['data', num2str(k), '.txt'],'w');
fprintf(fileID,'%f\n',a(:, k));
fclose(fileID);
end
5 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Low-Level File I/O dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!