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 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
% 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 Commenti
Risposte (1)
Walter Roberson
il 30 Nov 2017
filename = sprintf('trans%04d.txt', t);
dlmwrite(filename, transmat2)
0 Commenti
Vedere anche
Categorie
Scopri di più su Text Files in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!