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
Direct from engine compressor: A Load valve is switched on from the flightdeck, power for the switch is available once the APU has achieved 95% + 3 sec. This energises the swit

Flight dynmaics The study of aircraft- Stability & Trim (Equilibrium)- Motion due to • Control inputs • Atmospheric Disturbances • We will consider for the most part f

Q.   Discuss briefly the causes and remedies of Shrinkage cavities casting defects.                                                 OR  Why shrinkage cavities are caus

Divided entrance duct On a single engine aircraft with fuselage mounted engines, either a wing root inlet or a side scoop inlet may be used. The wing root inlet presents a pro

#question.what if i poured diesel in petrol engine and petrol in diesel engine.

A fund manager’s high growth portfolio is made up of 80% (w1) in shares and 20% (w2 ) in bonds. Over the course of year 2010, the returns from each asset class are expected to have

How to design heat exchanger project from aromatics from shale gas transport phenomena, CHE 306

how can you access the general purpose registers of Microprocessor in windows XP/2000/98...

need help correcting an error on running the developed app it doesnt show the fetched output from internet ?

Q.  Define co-ordination number. Ans.CO-ORDINATION NUMBER: The number of atoms which are directly surrounding a given atom is known as coordination number. Number of atoms w