From: adriana on
And what if your second argument (TXT) is empty?
Does anybody have an ideea how to read time from an xls file?
Or otherwise how to generate an array that looks like this: [00:00 00:10 00:20 00:30 00:40 00:50 01:00] without getting errors when is converted into a datestr ?
_____________________________________________________
TideMan <mulgor(a)gmail.com> wrote in message <8a9d7dda-d530-4fd7-9f31-418eae0f37e1(a)k20g2000pro.googlegroups.com>...
> On Jul 3, 1:10 pm, "Andrew Liu" <nos...(a)gmail.com> wrote:
> > TideMan <mul...(a)gmail.com> wrote in message <62413ae5-0427-4938-9313-11e6c9cbb...(a)s12g2000prc.googlegroups.com>...
> > > On Jul 3, 10:10 am, "Andrew Liu" <nos...(a)gmail.com> wrote:
> > > > Hello,
> >
> > > > This is my first post here! I hope you guys can help me out. I'm trying to write a code reading an excel spreadsheet. I have a list of time intervals (random times). But these time intervals corresponds to certain dates.
> >
> > > > Example:
> >
> > > > date                   time                  Values
> > > > 12/1/2010           13:00:00            0.01
> > > > 12/1/2010           13:00:25            0.01
> > > > 12/1/2010           22:31:00            0.01
> > > > 12/2/2010           13: 15:00           0.01
> > > > ..
> >
> > > > How do I make the matlab code read every 15 minute intervals and then add those 15 minutes?
> >
> > > > thank you!
> >
> > > To read the data into Matlab:
> > > help xlsread
> > > Pay particular attention to the second output argument.
> >
> > > As for this:
> > > "How do I make the matlab code read every 15 minute intervals and then
> > > add those 15 minutes?"
> > > Do you mean that you want to interpolate at 15 min intervals?
> > > And what do you want to add to what?
> >
> > > To get help here, you will have to explain yourself better.
> >
> > Sorry I didn't explain myself better. I want Matlab to read every 15 minutes and then add up the values that falls within every 15 minutes. So say, from the example, 13:00:00 and 13:00:15 (15 seconds apart) falls within 15 minutes. I want to add these two values up (.01 + .01 = .02). Then next, 22:31:00 and 13:15:00 is not 15 minutes apart. So, the next value would be 0.01 from the 22:31:00 and then again 0.01 from the 13:15:00.
> >
> > Does that make sense?
> >
> > I forgot how to do matlab. I havn't done it over a year, and I'm trying to brush up on it again. I gotta do this for my research. I'm guessing that I have to do something like if 00:00:00 to 00:15:00, sum, else 00:16:00 to 00:30:00 sum, else...?
> >
> > Thanks for your help!
>
> Well, the first step is to read all the data into Matlab using
> xlsread, then convert date and time to Matlab days using datenum.
> As I said earlier, you'll need to use the 2nd output argument of
> xlsread.