Writing results to different files
2 views (last 30 days)
Show older comments
Hi,
I am trying to make a code so that when I run my function, the results get saved in different files each time I run it. So for example, I run my code the first time, the results get saved in file 1 then file 2, file 3... so on Is there a way I can accomplish this?
0 Comments
Answers (1)
Stephen23
on 9 Nov 2015
Edited: Stephen23
on 9 Nov 2015
This is such a common question that we have a very detailed description in the wiki page, complete with example code. It has also be answered many times on this forum:
There are several different functions for saving data to text files. Picking the best one depends on the nature of your data, which you do not tell us anything about. You can find a list of these functions here:
3 Comments
Stephen23
on 9 Nov 2015
Edited: Stephen23
on 9 Nov 2015
You have not told us what x, y, and z are: are they numeric arrays, cell arrays of steings, tables, character arrays, mixed cell arrays, ...? Are they scalar, 2D, or ND arrays? Each of these requires a different approach to file writing. If you want to tell us exactly what they are, then er can help you to write them to file.
You also need to tell us the required file format, which you have not told us so far.
See Also
Categories
Find more on Data Type Conversion 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!