From: Nicholas Kinar on
Hello---

I have a CSV file with at least 7000 rows and 72 columns. Each column
has a header comprised of 5 rows. The first column is comprised of
dates in the form "01/03/10 10:45", where "DD/MM/YY hh:mm", and "DD" is
the day of the month, "MM" is the month, "YY" is the year, "hh" is the
hour, and "mm" is the minute. All columns except for the first one
contain numerical values expressible in double format. Missing values
in each column are indicated by "NAN"

I would like to import this CSV file into Matlab, ignore the first five
rows, and then plot the first date column on the x-axis, and another
column (say the 66th column) on the y-axis of a 2D plot.

Is there a way to do this in Matlab?

Nicholas
From: dpb on
Nicholas Kinar wrote:
....

> Is there a way to do this in Matlab?

yes...

--
From: Nicholas Kinar on
On 10-05-29 2:16 PM, dpb wrote:
> Nicholas Kinar wrote:
> ...
>
>> Is there a way to do this in Matlab?
>
> yes...
>
> --

Thanks for your response. How might I proceed? I've been trying to do
this with the readtext() function available on the file exchange, and
I'm not having very much luck with the cell arrays.

% read in the data
fileName = 'example.csv';
[infoString, result]= readtext(fileName);
time = infoString(:,1);
depth = infoString(:,66)

Now "time" and "depth" are cell arrays which are non-homogeneous,
containing both numbers and strings. How do I strip off the first few
rows and convert each column into numbers, given that each column also
contains "NAN" values?

Nicholas
From: Rune Allnor on
On 29 Mai, 22:48, Nicholas Kinar <n.ki...(a)usask.ca> wrote:
> On 10-05-29 2:16 PM, dpb wrote:
>
> > Nicholas Kinar wrote:
> > ...
>
> >> Is there a way to do this in Matlab?
>
> > yes...
>
> > --
>
> Thanks for your response. How might I proceed?  

By explaining what the problem is? This is a fairly trivial
exercise...

Rune
From: dpb on
Nicholas Kinar wrote:
> On 10-05-29 2:16 PM, dpb wrote:
>> Nicholas Kinar wrote:
>> ...
>>
>>> Is there a way to do this in Matlab?
>>
>> yes...
....

> Thanks for your response. How might I proceed? I've been trying to do
> this with the readtext() function available on the file exchange, ...

I'd suggest lookling at the file w/ the import wizard first; if it
handles it, that's probably the least intensive from user standpoint.

textscan() is more flexible than textread() Specifically, the
'collectoutputs' option will place the numerics in an array which is
convenient for plotting.

datenum() and friends works on cell arrays, too...

--