Function ismember - set operations, Other Engineering

function ismember - set operations:

The function ismember receives two vectors as input arguments, and returns a logical vector which is of similar length as the first argument, having 1 for true when the element in the first vector is also in the second, or 0 for false when not.

The order of arguments matters for this function.

>> v1

v1 =

2 3 4 5 6

>> v2

v2 =

1 3 5 7

>> ismember(v1,v2)

ans =

0 1 0 1 0

>> ismember(v2,v1)

ans =

0 1 1 0

 

By using the answer from the ismember function as an index into the first vector argument will return similar result as the intersect function.

>> logv = ismember(v1,v2)

logv =

0 1 0 1 0

>> v1(logv)

ans =

   3         5

>> logv = ismember(v2,v1)

logv =

0 1 1 0

>> v2(logv)

ans =

   3     5

Posted Date: 10/22/2012 7:35:05 AM | Location : United States







Related Discussions:- Function ismember - set operations, Assignment Help, Ask Question on Function ismember - set operations, Get Answer, Expert's Help, Function ismember - set operations Discussions

Write discussion on Function ismember - set operations
Your posts are moderated
Related Questions
Disadvantage of shunt diode clipper


Income statement: Sosa Corporation recently reported an EBITDA of $31.3 million and $9.7 million of net income. The company has $6.8 million interest expense, and the corporate tax

Synchro resolvers for low load: Both transmitter and receiver rotors are energised by the same AC supply and will induce equal and opposing voltages in the stator coils provide

Standard cost of the product

Industries that manufacture racing cars prefers nickel based alloys for engine components and iron based alloys for structural parts. Justify this statement.

The operational amplifier : The integrated circuit operational amplifier is one of the most useful and versatile electronic devices available today.  The name 'operational ampl


Compressor characteristics: When a compressor is designed it is essential to establish the points at which it is likely to surge. Tests are carried out to determine the relati

Auxiliary power unit oil System: A sump at the bottom of the gearbox collects the returning oil, in some APU's the rear face of the sump is finned and let into the intake plenu