writing data to a .txt file
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
shanmukh
le 23 Mai 2013
Réponse apportée : elham soltani
le 3 Nov 2014
i have 2 columns of data
a= { 1
2
3
4 }
b= { 5
6
7
8 }
i used
fprintf(f, '%d;%d;\n',[a b]);
i get output .txt file as
1;2;
3;4;
5;6;
7;8;
but i need data in this format
1;5;
2;6;
3;7;
4;8;
0 commentaires
Réponse acceptée
Azzi Abdelmalek
le 23 Mai 2013
fprintf(f, '%d%d\n',cell2mat([a'; b']));
2 commentaires
Azzi Abdelmalek
le 23 Mai 2013
if a and b are not cell array, use
fprintf(f, '%d%d\n',[a'; b']);
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Data Type Conversion dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!