help-octave
[Top][All Lists]
Advanced

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

Re: How to write cell array to csv file


From: Philip Nienhuis
Subject: Re: How to write cell array to csv file
Date: Wed, 17 Oct 2012 12:05:55 -0700 (PDT)

Terry Duell wrote
> Hullo All,
> I am having trouble writing out the contents of a cell array to a csv
> file.
> I have a string variable and a number of numeric variables that I have put  
> into a cell, eg
> 
> datacsv = { string1, T1, T2, T3}
> 
> I then want to write the cell out to a csv file, eg
> 
> csvwrite('testcsv', datacsv)
> 
> and I get the error...
> error: fprintf: wrong type argument `cell'
> 
> I have been having a bit trouble figuring out how best to tackle this, and  
> initially tried putting all the data into a normal array, eg
> 
> datacsv = [string1, T1, T2, T3]
> 
> and this approach wrote data to the csv file but it was incomprehensible,  
> so attempted the cell array approach.
> 
> Is there a way of writing out mixed string and numeric data in the one csv  
> record? If so could some one please point me in the right direction.

You could try cell2csv() and csvconcat() in the latest io package versions.

Philip



--
View this message in context: 
http://octave.1599824.n4.nabble.com/How-to-write-cell-array-to-csv-file-tp4645350p4645388.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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