<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264499</link>
    <title>MATLAB Central Newsreader - Timeseries function duplicate records error</title>
    <description>Feed for thread: Timeseries function duplicate records error</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 29 Oct 2009 18:51:03 -0400</pubDate>
      <title>Timeseries function duplicate records error</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264499#690791</link>
      <author>Bastian </author>
      <description>When I try to create a new timeseries object using the following code (read frmo a text file):   &lt;br&gt;
&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DateTime = FileContent{1,1}; %example: 07/30/07 15:32:35.0&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Temp = FileContent{1,2}; %example: 24.605&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ts = timeseries(Temp,DateTime);&lt;br&gt;
&lt;br&gt;
I get the following warning and error:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Warning: Duplicate records are detected and have been merged. &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;??? Error using ==&amp;gt; timeseries.init at 312&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Mismatch between the size of the data and the quality properties.&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Error in ==&amp;gt; timeseries.timeseries&amp;gt;timeseries.timeseries at 216&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this = init(this,varargin{:});&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Error in ==&amp;gt; ThermoSTATv2_Oct29_2009&amp;gt;pbtReadFile_Callback at 125&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ts = timeseries(Temp,DateTime);&lt;br&gt;
&lt;br&gt;
It looks like MATLAB has detected a duplicate record and has &quot;fixed&quot; the problem by &quot;merging&quot; the records. Then something happens that some other part of the timeseries function does not like because of the previous &quot;fix&quot;. Does anybody have any clever ideas on how to prevent this from happening? or some sort of work around? </description>
    </item>
    <item>
      <pubDate>Thu, 29 Oct 2009 20:11:26 -0400</pubDate>
      <title>Re: Timeseries function duplicate records error</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264499#690814</link>
      <author>NZTideMan</author>
      <description>On Oct 30, 7:51&#160;am, &quot;Bastian &quot;&lt;br&gt;
&amp;lt;bastianschm...@trentu.removethistext.ca&amp;gt; wrote:&lt;br&gt;
&amp;gt; When I try to create a new timeseries object using the following code (read frmo a text file): &#160;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &#160; &#160; DateTime = FileContent{1,1}; %example: 07/30/07 15:32:35.0&lt;br&gt;
&amp;gt; &#160; &#160; Temp = FileContent{1,2}; %example: 24.605&lt;br&gt;
&amp;gt; &#160; &#160; ts = timeseries(Temp,DateTime);&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I get the following warning and error:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &#160; &#160;Warning: Duplicate records are detected and have been merged.&lt;br&gt;
&amp;gt; &#160; &#160;??? Error using ==&amp;gt; timeseries.init at 312&lt;br&gt;
&amp;gt; &#160; &#160;Mismatch between the size of the data and the quality properties.&lt;br&gt;
&amp;gt; &#160; &#160;Error in ==&amp;gt; timeseries.timeseries&amp;gt;timeseries.timeseries at 216&lt;br&gt;
&amp;gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; this = init(this,varargin{:});&lt;br&gt;
&amp;gt; &#160; &#160;Error in ==&amp;gt; ThermoSTATv2_Oct29_2009&amp;gt;pbtReadFile_Callback at 125&lt;br&gt;
&amp;gt; &#160; &#160; ts = timeseries(Temp,DateTime);&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; It looks like MATLAB has detected a duplicate record and has &quot;fixed&quot; the problem by &quot;merging&quot; the records. Then something happens that some other part of the timeseries function does not like because of the previous &quot;fix&quot;. Does anybody have any clever ideas on how to prevent this from happening? or some sort of work around?&lt;br&gt;
&lt;br&gt;
Before going into timeseries, use the function unique on DateTime to&lt;br&gt;
remove duplications of time.  You will also need to eliminate the&lt;br&gt;
corresponding rows in Temp:&lt;br&gt;
[DateTimeNew,indx]=unique(DateTime);&lt;br&gt;
TempNew=Temp(indx);</description>
    </item>
    <item>
      <pubDate>Thu, 29 Oct 2009 20:29:03 -0400</pubDate>
      <title>Re: Timeseries function duplicate records error</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264499#690817</link>
      <author>Bastian </author>
      <description>NZTideMan &amp;lt;mulgor@gmail.com&amp;gt; wrote in message &amp;lt;5b388161-e844-4448-ae52-b6ce29dab679@y32g2000prd.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; On Oct 30, 7:51?am, &quot;Bastian &quot;&lt;br&gt;
&amp;gt; &amp;lt;bastianschm...@trentu.removethistext.ca&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; When I try to create a new timeseries object using the following code (read frmo a text file): ?&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; ? ? DateTime = FileContent{1,1}; %example: 07/30/07 15:32:35.0&lt;br&gt;
&amp;gt; &amp;gt; ? ? Temp = FileContent{1,2}; %example: 24.605&lt;br&gt;
&amp;gt; &amp;gt; ? ? ts = timeseries(Temp,DateTime);&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I get the following warning and error:&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; ? ?Warning: Duplicate records are detected and have been merged.&lt;br&gt;
&amp;gt; &amp;gt; ? ???? Error using ==&amp;gt; timeseries.init at 312&lt;br&gt;
&amp;gt; &amp;gt; ? ?Mismatch between the size of the data and the quality properties.&lt;br&gt;
&amp;gt; &amp;gt; ? ?Error in ==&amp;gt; timeseries.timeseries&amp;gt;timeseries.timeseries at 216&lt;br&gt;
&amp;gt; &amp;gt; ? ? ? ? ? ? ? ? ? this = init(this,varargin{:});&lt;br&gt;
&amp;gt; &amp;gt; ? ?Error in ==&amp;gt; ThermoSTATv2_Oct29_2009&amp;gt;pbtReadFile_Callback at 125&lt;br&gt;
&amp;gt; &amp;gt; ? ? ts = timeseries(Temp,DateTime);&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; It looks like MATLAB has detected a duplicate record and has &quot;fixed&quot; the problem by &quot;merging&quot; the records. Then something happens that some other part of the timeseries function does not like because of the previous &quot;fix&quot;. Does anybody have any clever ideas on how to prevent this from happening? or some sort of work around?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Before going into timeseries, use the function unique on DateTime to&lt;br&gt;
&amp;gt; remove duplications of time.  You will also need to eliminate the&lt;br&gt;
&amp;gt; corresponding rows in Temp:&lt;br&gt;
&amp;gt; [DateTimeNew,indx]=unique(DateTime);&lt;br&gt;
&amp;gt; TempNew=Temp(indx);&lt;br&gt;
&lt;br&gt;
Thanks, that's done it. I had been trying to make use of the &quot;unique&quot; 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.</description>
    </item>
  </channel>
</rss>

