Function setxor and set function unique - set operations, Other Engineering

Function setxor and set function unique:

The function setxor receives two vectors as input arguments, and returns a vector having all the values from the two vectors which are not in the intersection of these two vectors. In another word, it is the union of two vectors obtained by using setdiff former!

>> setxor(v1,v2)

ans =

1 2 4 6 7

>> union(setdiff(v1,v2), setdiff(v2,v1))

ans =

1 2 4 6 7

The set function unique returns all the exclusive values from the set argument:

>> v3 = [1:5 3:6]

v3 =

1 2 3 4 5 3 4 5 6

>> unique(v3)

ans =

1 2 3 4 5 6

Most of the set functions return vectors which can be used to index into the original vectors as optional output arguments; for illustration, for the two vectors v1 and v2 defined formerly as:

>> v1

v1 =

2 3 4 5 6

>> v2

v2 =

1 3 5 7

Posted Date: 10/22/2012 7:33:27 AM | Location : United States







Related Discussions:- Function setxor and set function unique - set operations, Assignment Help, Ask Question on Function setxor and set function unique - set operations, Get Answer, Expert's Help, Function setxor and set function unique - set operations Discussions

Write discussion on Function setxor and set function unique - set operations
Your posts are moderated
Related Questions
Propeller control : CONSTANT SPEED UNIT: In the normal flight range, the main control of the propeller is exercised by the propeller control unit (PCU). MANUAL AND AU

in which type of armature winding Equaliser ring dummy coils are used


A car, moving in the south-east direction at a velocity of 5 m/s, receives a ray of power of -120 dBm each from the north, east and west. The carrier frequency is 300 MHz. (i) Sket

how to find out the number of select lines while construcing a mux or a demux logic diagram?

tunnel diode

A company issues 15-year, $1,000 par-value bonds, with a coupon rate of 5%. The bonds are sold for $619.70. The tax rate is 30%. Compute the cost of debt before taxes and after tax

explain hydrogen bonding & impotents of it

A heat recovery device involves transferring energy from hot flue gases passing counter currently through an annular region to pressurized water flowing through the inner tube of t

Q. Explain the Chaplets.                                                       OR  When are chaplets required in moulding practice? What is the material of the chaplets?