Maybe like this: [dummy, index] = find(kron(a, ones(length(b),1)) - kron(b', ones(a)) == 0)
Don't know if it is fast. Cheers, Arvid 28 okt 2012 kl. 19:25 skrev Orbeman <[email protected]>: > Hello, > > Does anyone have an idea to modify the native intersect function in Scilab. > I would like to have all positions (not only for unique element) of a vector > that is in an other vector. I prefer avoid any loop because it's huge > matrix. > > For example, a=[1 2 3 2 3 4 5 2 6 3] and b=[2 3] give c=[2 3 4 5 8 10] as > result. > > Thanks. > > Sorry, for my bad english. I hope its understable. > > > > -- > View this message in context: > http://mailinglists.scilab.org/Intersection-of-two-vectors-tp4025092.html > Sent from the Scilab developers - Mailing Lists Archives mailing list archive > at Nabble.com. > _______________________________________________ > dev mailing list > [email protected] > http://lists.scilab.org/mailman/listinfo/dev -- Arvid Rosén Softube AB S:t Larsgatan 10c SE-582 24 Linköping Sweden Mobile: (+46) 73 25 123 47 Office: (+46) 13 21 16 23 Fax: (+46) 13 10 00 23 Mail: [email protected] URL: www.softube.com
_______________________________________________ dev mailing list [email protected] http://lists.scilab.org/mailman/listinfo/dev
