|
From: | Przemek Klosowski |
Subject: | Re: Data clustering |
Date: | Mon, 23 Jun 2014 14:41:51 -0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
On 06/23/2014 11:06 AM, CdeMills wrote:
data.data <http://octave.1599824.n4.nabble.com/file/n4664952/data.data> Any idea on how to automatically cluster such kind of data ? findpeaks(abs(diff(Signal))) using findpeaks from the signal toolbox, except that it's touchy and works on its demo data but throws error on this dataset that actually looks promising when plotted: error: findpeaks: subscript indices must be either positive integers or logicals error: called from: error: /usr/share/octave/packages/signal-1.2.2/findpeaks.m at line 126, column 5 Does anyone understand why we're getting this error? BTW, diff(Signal) has one less datapoint than Signal, so it really should be [0; diff(Signal)]. This comes up often, for instance when plotting: plot(x,y,x,diff(y)) doesn't work, so I just write plot(x,y,x,[0;diff(y)]). I suppose one could argue that mathematically, the more correct plot is plot(x,y,x(1:end-1)+diff(x)/2,diff(y)) but this is such a common calculation that maybe someone can suggest a more concise way of writing either the shorter X vector or adding one extra point on Y. |
[Prev in Thread] | Current Thread | [Next in Thread] |