intersect function and setdiff functionthe


Intersect function and setdiff function:

The intersect function rather than returns all the values which can be found in both of the input argument vectors.

>> intersect(v1,v2)

ans =

    3   5

The setdiff function receives two vectors as input arguments, and returns a vector having all the values which are contained in the first vector argument but not in the second. And hence, the order of the two input arguments is very important.

>> setdiff(v1,v2)

ans =

2 4 6

>> setdiff(v2,v1)

ans =

    1   7

Request for Solution File

Ask an Expert for Answer!!
Applications of MATLAB: intersect function and setdiff functionthe
Reference No:- TGS0175344

Expected delivery within 24 Hours