help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

using find function to wrap set functions


From: thombark
Subject: using find function to wrap set functions
Date: Wed, 26 Oct 2011 06:21:27 -0700 (PDT)

I would like to use "find" with some set functions, because a for loop takes
too much time. For example, I have a large array  aa (100000,10) where each
row has 10 numbers. I want to use the complement function to find all rows
that contain the values [12 54 77]. This code is too slow:

for ix = 1:rows(aa)
        if (columns(complement (aa(ix,:), [12 54 77])) == 0)
        ...save ix...
        endif
endfor  

I would like to wrap this in a find function, but I don't know the syntax
for this.

find(columns(complement (aa(:,:), [8 43])) == 0); does not work.

Thanks


--
View this message in context: 
http://octave.1599824.n4.nabble.com/using-find-function-to-wrap-set-functions-tp3940581p3940581.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]