Transpose column from .csv file
5 ビュー (過去 30 日間)
古いコメントを表示
How can I transpose a column that is read from a .csv file? Currently I am reading the column, transposing it, and reprinting it. However, all of the numbers are crunched together into one cell. When I transpose, I need to have commas between each of my columns (or what used to be the end of a row, before the transpose took place).
-- This is what I am trying, but it does not work
C1 = dlmread(strcat(GlotaranFileName,'.csv'), ',', [0 1 lineCount 1]);
fprintf(fid, '%d', C1'); % write the relevent data to the file
thanks
0 件のコメント
採用された回答
Walter Roberson
2012 年 10 月 22 日
fprintf(fid, '%d,', C1(1:end-1)'); %notice the comma after %d
fprintf(fid, '%d\n', C1(end));
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!