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
limitations of nernsts law

Thrust calculation: The amount of thrust produced depends upon two things:- The MASS of air which is moved rearwards in a given time, the ACCELERATION imparted to the air.It

different types of switches used in CRO

How can I get my assignment without plagiarism


Interior noise is basically airborne or structure-borne. The excitation sources of vibratation and noise from engines can be divided as mechanical, combustion, and flow sources.

We are interested in the supersonic flow of air through a convergent-divergent nozzle having a circular cross-sectional area, A, that varies with axial distance from the throat, x,

Lift and drag are merely the resolved components in specific directions of a resultant aerodynamic force caused by the relative velocity V of the vehicle through the air. If al

what is diode?

Answer the following questions: What are the three forms of a business organization? What are the advantages and disadvantages of each form? For a corporation, what is the overall