Nikke
Electrical
- Nov 16, 2005
- 2
I have to export 2 vectors in 2 different .txt files. My entire program is a loop repeated about 250 times. At the end of every loop, I want to export the results (2 vectors, one is 1X8 and one is 1X4) in two different .txt files (ie: a.txt and b.txt). I've tried to use the function "dlmwrite" this way:
>>dlmwrite('a.txt', C, ';');
>>dlmwrite('b.txt, O, ';');
but the files are overwrited everytime the loop is repeated. So my solutions are twice but I really dunno how to do them:
1) Change the name of the .txt file for every loop I make, so that at the end of the program I have 250X2 files.
2) Create two tables where I write the values of C and O for every loop without overwriting the existing values, so that at the end of the program I have 2 files (two tables in this case) with 250 rows and 8 columns for the first file and 4 columns for the second file.
The second solution is the better for me and maybe is simplier too.
Nikke
>>dlmwrite('a.txt', C, ';');
>>dlmwrite('b.txt, O, ';');
but the files are overwrited everytime the loop is repeated. So my solutions are twice but I really dunno how to do them:
1) Change the name of the .txt file for every loop I make, so that at the end of the program I have 250X2 files.
2) Create two tables where I write the values of C and O for every loop without overwriting the existing values, so that at the end of the program I have 2 files (two tables in this case) with 250 rows and 8 columns for the first file and 4 columns for the second file.
The second solution is the better for me and maybe is simplier too.
Nikke