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 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
% 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 Kommentare
Antworten (1)
Walter Roberson
am 30 Nov. 2017
filename = sprintf('trans%04d.txt', t);
dlmwrite(filename, transmat2)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Text Files 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!