Thread Subject: Timeseries function duplicate records error

Subject: Timeseries function duplicate records error

From: Bastian

Date: 29 Oct, 2009 18:51:03

Message: 1 of 3

When I try to create a new timeseries object using the following code (read frmo a text file):
 
    DateTime = FileContent{1,1}; %example: 07/30/07 15:32:35.0
    Temp = FileContent{1,2}; %example: 24.605
    ts = timeseries(Temp,DateTime);

I get the following warning and error:

   Warning: Duplicate records are detected and have been merged.
   ??? Error using ==> timeseries.init at 312
   Mismatch between the size of the data and the quality properties.
   Error in ==> timeseries.timeseries>timeseries.timeseries at 216
                  this = init(this,varargin{:});
   Error in ==> ThermoSTATv2_Oct29_2009>pbtReadFile_Callback at 125
    ts = timeseries(Temp,DateTime);

It looks like MATLAB has detected a duplicate record and has "fixed" the problem by "merging" the records. Then something happens that some other part of the timeseries function does not like because of the previous "fix". Does anybody have any clever ideas on how to prevent this from happening? or some sort of work around?

Subject: Timeseries function duplicate records error

From: NZTideMan

Date: 29 Oct, 2009 20:11:26

Message: 2 of 3

On Oct 30, 7:51 am, "Bastian "
<bastianschm...@trentu.removethistext.ca> wrote:
> When I try to create a new timeseries object using the following code (read frmo a text file):  
>
>     DateTime = FileContent{1,1}; %example: 07/30/07 15:32:35.0
>     Temp = FileContent{1,2}; %example: 24.605
>     ts = timeseries(Temp,DateTime);
>
> I get the following warning and error:
>
>    Warning: Duplicate records are detected and have been merged.
>    ??? Error using ==> timeseries.init at 312
>    Mismatch between the size of the data and the quality properties.
>    Error in ==> timeseries.timeseries>timeseries.timeseries at 216
>                   this = init(this,varargin{:});
>    Error in ==> ThermoSTATv2_Oct29_2009>pbtReadFile_Callback at 125
>     ts = timeseries(Temp,DateTime);
>
> It looks like MATLAB has detected a duplicate record and has "fixed" the problem by "merging" the records. Then something happens that some other part of the timeseries function does not like because of the previous "fix". Does anybody have any clever ideas on how to prevent this from happening? or some sort of work around?

Before going into timeseries, use the function unique on DateTime to
remove duplications of time. You will also need to eliminate the
corresponding rows in Temp:
[DateTimeNew,indx]=unique(DateTime);
TempNew=Temp(indx);

Subject: Timeseries function duplicate records error

From: Bastian

Date: 29 Oct, 2009 20:29:03

Message: 3 of 3

NZTideMan <mulgor@gmail.com> wrote in message <5b388161-e844-4448-ae52-b6ce29dab679@y32g2000prd.googlegroups.com>...
> On Oct 30, 7:51?am, "Bastian "
> <bastianschm...@trentu.removethistext.ca> wrote:
> > When I try to create a new timeseries object using the following code (read frmo a text file): ?
> >
> > ? ? DateTime = FileContent{1,1}; %example: 07/30/07 15:32:35.0
> > ? ? Temp = FileContent{1,2}; %example: 24.605
> > ? ? ts = timeseries(Temp,DateTime);
> >
> > I get the following warning and error:
> >
> > ? ?Warning: Duplicate records are detected and have been merged.
> > ? ???? Error using ==> timeseries.init at 312
> > ? ?Mismatch between the size of the data and the quality properties.
> > ? ?Error in ==> timeseries.timeseries>timeseries.timeseries at 216
> > ? ? ? ? ? ? ? ? ? this = init(this,varargin{:});
> > ? ?Error in ==> ThermoSTATv2_Oct29_2009>pbtReadFile_Callback at 125
> > ? ? ts = timeseries(Temp,DateTime);
> >
> > It looks like MATLAB has detected a duplicate record and has "fixed" the problem by "merging" the records. Then something happens that some other part of the timeseries function does not like because of the previous "fix". Does anybody have any clever ideas on how to prevent this from happening? or some sort of work around?
>
> Before going into timeseries, use the function unique on DateTime to
> remove duplications of time. You will also need to eliminate the
> corresponding rows in Temp:
> [DateTimeNew,indx]=unique(DateTime);
> TempNew=Temp(indx);

Thanks, that's done it. I had been trying to make use of the "unique" function but was stumped by the fact that it sorts the output. I now realize that this does not matter since timeseries puts the times back in order automatically! Thanks again for your help.

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com