[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How can I this efficiently? common rows in two data sets
From: |
Keith Goodman |
Subject: |
Re: How can I this efficiently? common rows in two data sets |
Date: |
Thu, 12 May 2005 11:29:48 -0700 |
I would stack the two datasets into a single dataset. Then I would use
sortrows on the time column. Then do time(2:end)-time(1:end-1)==0 to
find matches. Then pull the matched rows out into a new matrix.
On 5/12/05, Rick Niles <address@hidden> wrote:
> OK I have a problem I hit a lot and I haven't come up with a good way to
> do this Octave. I was wondering if there's a good way to do this or if
> it's a opportunity for another built-in oct-file if there's not a good
> way to do it with the current set of the functions.
>
> I have two data files, each has one column that represents "time". But
> they don't start and stop at the same time and either may have random
> drop-outs (no-data) for any amount of time. The obvious thing to do
> make a common data set that only contains the times (rows) for which I
> have data from both sets.
>
> I tried using "intersection()" on the time columns and doing a for loop
> with "find()" for each time value one at a time to get the indexes that
> have common time, but on a large data set it's really slow and obviously
> not very efficient.
>
> As lots of people use Octave to process real data sets it seems like
> there should be a good way to do this.
>
> Any ideas?
>
> Thanks,
> Rick Niles.
>
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
>
> Octave's home on the web: http://www.octave.org
> How to fund new projects: http://www.octave.org/funding.html
> Subscription information: http://www.octave.org/archive.html
> -------------------------------------------------------------
>
>
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------