Man Scilab

intersect
Scilab Function

intersect - returns the vector of common values of two vectors

Calling Sequence

[v, [ka,kb]]=intersect(a,b)

Parameters

Description

intersect(a,b) returns a sorted row vector of common values of two vectors of a and b .

[v,ka,kb]=intersect(a,b) also returns index vectors ka and kb such that v=a(ka) and v=b(kb) .

Examples


A=round(5*rand(10,1));
B=round(5*rand(7,1));

intersect(A,B)
[N,ka,kb]=intersect(A,B)

intersect('a'+string(A),'a'+string(B))

 
  

See Also

unique ,   sort ,   union ,  

Back