in a csv file, it is a line like(45,85,65,98,36,56,83,10,8,7),how can i make it 10*1 cell? thanks
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
pengcheng
am 15 Okt. 2014
Kommentiert: Star Strider
am 15 Okt. 2014
the result what i want is:
45
85
65
98
36
83
10
8
7
I try to write like this
fid = fopen('R003.csv', 'wt');
fprintf(fid, '%s\n', R{:});
fclose(fid);
but the result has a small problem the result is like this
45,85,65,98,36,56,83,10,8,7
85
65
98
36
83
10
8
7
can you help me? thanks
0 Kommentare
Akzeptierte Antwort
Star Strider
am 15 Okt. 2014
Bearbeitet: Star Strider
am 15 Okt. 2014
Create it as a column vector, then write it:
V = [45,85,65,98,36,56,83,10,8,7]'; % Note Transpose
csvwrite('R003.csv', V)
4 Kommentare
Star Strider
am 15 Okt. 2014
My pleasure!
If it worked for you, I would appreciate it if you would Accept my Answer.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Whos finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!