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
Furnace limit switches are wired in series with the?

Railway Inspections - fire safety management: Railway premises can be anything from small open air stations to large underground complexes and the fire safety measures that ar

The second order (two degree of freedom) Dutch-Roll approximation is an approximation to the above fourth order system for the Dutch Roll dynamics. A justification for this is to c

i want to make a project which is based on video transmission via laser ..please help me

Solving Poisson''s equation find out electric field in the transition region and show that electric field is maximum at the junction of p-n diode

PROBLEM BASED ON USING CHEBYSCHEV IIR FILTER USING BILINEAR TRANSFORMATION


Explain the following observations: cells of Escherichia coli fermenting glucose grow faster when NO3 - is supplied to the culture and then grow even faster when the culture is hig

A steel cylinder 10 cm in diameter and 10 cm long is initially at 300 0C. it is immersed in an oil bath which is maintained at 40 0C, with h= 280 W/m2. 0C. Find the temperature at

Actuators  The actuator consists of the control surfaces and associated servomechanisms, and is used to change the missile attitude and trajectory or flight path.