help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using cell2csv


From: Terry Duell
Subject: Using cell2csv
Date: Tue, 11 Jun 2013 15:08:11 +1000
User-agent: Opera Mail/12.15 (Linux)

Hello All,
I'm running into a few difficulties figuring how best to use "cell2csv" to capture results. I really don't have a sound grasp of cell array indexing, and that isn't helping. In my script I first generate a cell array "datavals{1}" to hold text describing the contents of each column of data in the csv file.
On each run through a loop I then add my calculated values as follows...

datavals{i+1}={filename, val1, val2, val3...};

When the calculation loops are done, I am trying to write "datavals" to a file, with the aim of having each entry written to the file as a separate record, using the following...
 for i=1:n
        cell2csv("filename",datavals{i});
end

but this only leaves me with the values for the last write operation, ie the file is being overwritten.
It doesn't seem like "cell2csv" has an "append" switch.
I have tried opening a file...

fp = fopen("filename","a");

and using

cell2csv(fp, datavals{i}); within my write loop, but that also ends up with only the last write.

Can someone please point me to a solution?

Cheers,
--
Regards,
Terry Duell


reply via email to

[Prev in Thread] Current Thread [Next in Thread]