save a m*n cell file as n text files
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Bhaskar panchireddi
il 2 Giu 2016
Commentato: Bhaskar panchireddi
il 2 Giu 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
Risposta accettata
Ahmed Rashid
il 2 Giu 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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Data Import and Export in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!