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
Numerical solutions to equations: Many practical problems in engineering involve complex boundary conditions and variable properties that cannot be solved analytically, creat

IGNITION SYSTEMS The outline of a high energy ignition system is illustrated in the figure. Each high energy ignition unit has a low voltage supply which is controlled by the

can you formulate a program using only bubblesort for assigning grades in an array?

The town of Smog, Idaho is located in a river valley and has a footprint of 6 km x 2 km. It has an average daily emission rate of 1000 kg/day of PM2.5 into the atmosphere from wood

Q. What are the limitations of the powder metallurgy process ? How are some of these overcome ? Ans. Limitations : 1. Dies and equipment costs are high. So, the process

dc load line for a diode & same for circuit consisting of supply voltage in series with resistance & diodes

The figure below compares the discrete solution with the exact analytical solution The error is largest at the right boundary where it is equal to solution. The error is largest at

Let C(K) denote a European vanilla Call option with strike price K. Assume that all options are identical except for strike price, and strike prices satisfy (K1) What are the no-

Resistive transducers Linear or rotary potentiometers can be adapted to measure displacement, possibly through mechanical gearing and linkages. The displacement is registered a