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
HOW TO MAKE ROTATING FRAME

apply equations to solve problems for specified aerodynamic applications. Need some inputs regarding this.

#questiWrite a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two point

Compressor stall and surge: ‘Surge' can occur in both centrifugal and axial flow compressors and is the reversal of the airflow in the compressor. It is a very undesirable con

In the previous discussion, we investigated the static aeroelastic behaviour of straight (unswept) wings. These wings are characterised by an effective decoupling of wing bending a

The idea of stability derivatives is to approximate the general functional relationship between any force ormoment variable and the dynamic or control variables as a Taylor series

Q. What are refractory's? How are they classified? Give the essential requirements of good refractories.                                                    OR Discuss cla

simplied hybrid model of cc amplifier

BASIC ENGINE DESIGN CONSIDERATIONS Effect of engine size: The two parameters involved are the diameter, d and stroke, L of the engine. The effect of doubling each of this

Differentiator: With negative feedback applied through a resistor and the input signal through a capacitor, the circuit will perform the mathematical operation of differentiati