<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Maybe like this:</div><div><br></div>[dummy, index] = find(kron(a, ones(length(b),1)) - kron(b', ones(a)) == 0)<div><br></div><div>Don't know if it is fast.</div><div><br></div><div>Cheers,</div><div>Arvid</div><div><br><div><div>28 okt 2012 kl. 19:25 skrev Orbeman <<a href="mailto:ludo.wag@laposte.net">ludo.wag@laposte.net</a>>:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hello,<br><br>Does anyone have an idea to modify the native intersect function in Scilab.<br>I would like to have all positions (not only for unique element) of a vector<br>that is in an other vector. I prefer avoid any loop because it's huge<br>matrix.<br><br>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<br>result.<br><br>Thanks.<br><br>Sorry, for my bad english. I hope its understable.<br><br><br><br>--<br>View this message in context: <a href="http://mailinglists.scilab.org/Intersection-of-two-vectors-tp4025092.html">http://mailinglists.scilab.org/Intersection-of-two-vectors-tp4025092.html</a><br>Sent from the Scilab developers - Mailing Lists Archives mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<br>_______________________________________________<br>dev mailing list<br><a href="mailto:dev@lists.scilab.org">dev@lists.scilab.org</a><br>http://lists.scilab.org/mailman/listinfo/dev<br></blockquote></div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>--</div><div>Arvid Rosén</div><div><br></div><div>Softube AB</div></div></span>S:t Larsgatan 10c<br>SE-582 24 Linköping<br>Sweden<br>Mobile: (+46) 73 25 123 47<br>Office: (+46) 13 21 16 23<br>Fax: (+46) 13 10 00 23<br>Mail: <a href="mailto:arvid@softube.com">arvid@softube.com</a><br>URL: <a href="http://www.softube.com/">www.softube.com</a></div></span></div></span></span>
</div>
<br></div></body></html>