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

Assignment Help:

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


Related Discussions:- Function setxor and set function unique - set operations

Determine payback and npv, Payback & NPV Julia Corp. is in the business o...

Payback & NPV Julia Corp. is in the business of making sugar cookies. The company is considering the purchase of a new cookie making machine which will improve its manufacturing

Restoration of clipped speech signal, Restoration of clipped speech signal ...

Restoration of clipped speech signal using linear prediction

Thermodynamics, Air at 1bar and 30 degreeC is to be compressed to 1.2 bar a...

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.

Design, 10 vertical examples

10 vertical examples

Electricity generation, Q. The Electricity generation in Florida is 224,750...

Q. The Electricity generation in Florida is 224,750GWh/y. What is the annual generation per capita? Knowing the population of Florida, the electricity generation per capita is 1

Hot and cold working, advantages and disadvantages of cold and hot working

advantages and disadvantages of cold and hot working

Water haedness, hardness of bore well water is less than sea water

hardness of bore well water is less than sea water

Where do you think by djia?, Where do you think by DJIA? Nobody knows th...

Where do you think by DJIA? Nobody knows the respond to this one. However, you should at least have some ideas on the topic and be able to communicate why you think this is the

Agricultural engineering , Agricultural engineering does not easily mean on...

Agricultural engineering does not easily mean only fruits and vegetables formed from the fields. Agriculture has come up with a dissimilar  look now. When you open a paouch of chip

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd