dlewriteで単語を一つのセルに複数のセルに分かれてしまう
Show older comments
filenemae = 'No.1-1result.,at'
a = 'result.csv';
C = cellstr(filename);
dlmwrite(a,C,'-append');
これでCSVファイルに書き出すと、failenameが複数のセルに分かれてしまいますどうしたらよいでしょうか
Answers (1)
dlmwrite だと1文字1文字がコンマ区切りで出力されることは避けられないみたいですね。
R2019a から使える writematrix や writecell 関数にも 'WriteMode' で 'append' が用意されているので、こちらではいかがでしょう。
writematrix(A,filename,'WriteMode','append')
という形で dlmwrite とはファイル名の入力位置が違いますが、
a = 'No.1-1result.,at';
filename = 'result.csv';
writematrix(a,filename,'WriteMode','append')
となります。
a がセル配列であれば writecell 関数を使ってください。
Categories
Find more on テキスト ファイル in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!