How can I create a .txt files from a cellarray that is 80x1 into 80 different files with the same name with different number in the end?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Carlos Hernandez
le 8 Nov 2023
Commenté : Carlos Hernandez
le 8 Nov 2023
LF{80x1} cell array
writematrix(LF{#},'LF#.txt','Delimiter','\t');
type LF#.txt
I want to create an inidvidual .txt file for each cell of the cell array with a succession of numbers without changing manually.
For example
cell array 1
LF{1} that creates a .txt file named LF1.txt
0 commentaires
Réponse acceptée
Walter Roberson
le 8 Nov 2023
for K = 1 : numel(LF)
filename = "LF" + K + ".txt";
writematrix(LF{K}, filename, 'Delimiter', '\t');
end
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Text Files 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!