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
Air at 1bar and 30 degreeC is to be compressed to 1.2 bar at the rate of 50m3/min. find the power required by a roofs blower.

difference between inline code and code behind file in asp.net

how to get ns2 coding for nash equilibrium


Question #1 Which of the following statements is false? A) For corporations, interest paid on its debt is a tax deductible expense. B) For corporations, dividend paid on its

"Whether you are writing, listening, speaking, or attending meetings, communication skills are critical to your success in University and the workplace". Discuss. Since entering

Casting Alloys are -             (i) Permanent moulds are commonly used for the casting of grey iron, aluminum alloys and magnesium alloys.             (ii) Slush Casting

Electronic engine control systems : Advances in gas turbine technology have demanded more precise control of engine parameters than can be provided by hydromechanical fuel cont

Design, Construction and Type Certificate The following chapter covers the initial design, construction, registration and test flying of the first prototype of a new aircraft.

explain application of zener diode for meter protection