Add new line inside text file
Show older comments
Dear All,
I have a txt file containing:
a, b, c, d, e, f, g, h, i
I have an iteration:
for i=1:10
for j=1:10
dlmwrite('mydata.txt', myvar, '');
end
end
The problem is that it overwrite what I already have in my txt file and it only writes the last value.
What I want as a result in my mydata.txt is something like:
a, b, c, d, e, f, g, h, i
1, 3, 6, 4, 8, 1, 8, 9, 0
2, 5, 6, 7, 5, 4, 2, 9, 4
...
Thank you and regards, Sypou
Accepted Answer
More Answers (0)
Categories
Find more on Text Files 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!