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
According to this it is impossible to specify precisely and simultaneously two physical quantities those are canonically conjugate to each other and the product of the uncertainty

a hexagonal prism of 40mm side length of base and height 80mm is resting on HP on its base with two edges of base is parallel to horizontal plane. A square hall of equally inclined

How do comets get their tails? - Most comets stay frozen in the outer solar system. Only a few enter the inner solar system where they can grow tails. - When a comet nears the sun

Exhaust Jet Mixing: Figure shows that the noise from the exhaust jet is the main contributor to the total noise generated by a low by-pass ratio turbo-fan. For a turbo-jet the

how to develop an algorithm that will accept the names of sales staff members and the total sales for the month.the algorithm must calculate the commission of 3% of the total sales

Examining the circuit of an amplifier you’d find many electrical components, of which all play a role only they can fulfill. Among these components, it is the transistor which pla

I need report explain every things about my project

Consider the binary cycle using the sodium and steam/water in the sketch below and operating at conditions in Table 1. Draw T S Diagram and find the thermal cycle efficiency

Q. What are the commented carbides? How are they processed? Ans. These are very important products of powder metallurgy and finds wide applications as cutting tools, wir