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
need it in 10 days time and in Australian cods if there is

Give two functions of dimensions.


Q.  With necessary theory explain the formation of spectrum by a plane transmission grating when composite light falls on it OR How does plane diffraction grating for

PROPELLER SPINNERS All modern propeller-driven aeroplanes have spinners over their propeller hubs. These spinners have the dual aerodynamic function of streamlining the engine

process / description.. if I put A=1000 and B=0100 A>B gate will show output 1 and dose A

Guides for the fire risk assessment: In the UK, the Government produce guides for the FRA process that are free to download.   There are a range of guides covering  the ran

Manual override relays: When the manual-override relays are not energised, this current flows through brushes riding on slip rings mounted on the propeller spinner bulkhead and

Oil tank: The oil tank is usually mounted on the engine; it may be a separate unit or part of an external gearbox called the sump. It has provision to allow the system to be f