writing data to a .txt file
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
shanmukh
am 23 Mai 2013
Beantwortet: elham soltani
am 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 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 23 Mai 2013
fprintf(f, '%d%d\n',cell2mat([a'; b']));
2 Kommentare
Azzi Abdelmalek
am 23 Mai 2013
if a and b are not cell array, use
fprintf(f, '%d%d\n',[a'; b']);
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!