Hello, I would like to know how to store matrix values in a textfile. I am creating a 5x5 matrix in a for loop and in each iteration I have to export this matrix into a text file. When I use the dlmwrite function, it overwrites. How can I solve this
2 ビュー (過去 30 日間)
古いコメントを表示
% transmat2 is a 5x5 Matrix
for t = 1:1:3
[LL, prior2, transmat2, obsmat2] = dhmm_em(data, prior1, transmat1, obsmat1,'max_iter', 1);
dlmwrite('trans.txt',transmat2,);
end
0 件のコメント
回答 (1 件)
Walter Roberson
2017 年 11 月 30 日
filename = sprintf('trans%04d.txt', t);
dlmwrite(filename, transmat2)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Text Files についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!