Fri 06 Mar 2015 04:44:50 PM UTC, original submission:
Here is a minimum working example that should illustrate the function's deficiencies:
length = 1000; %or any number you desire
randNum = 14;
A = randNum*ones(1, length);
B = randNum*ones(1, length);
[C, Ia, Ib] = intersect(A, B);
As described in the header, intersect does not return the correct output. In this instance, I observe the output as follows,
C = 14
Ia = 1000
Ib = 1000
when clearly C, Ia, and Ib should all be 1x1000 vectors where C is the common value 14, and Ia and Ib contain the numbers 1 thru 1000 or
C = [14, 14, 14, etc...]
Ia = [(1,1),(1,2),(1,3), etc...]
Ib = [(1,1),(1,2),(1,3), etc...]
Thanks for making Octave what it is today!
|