Function ismember - set operations, Other Engineering

Assignment Help:

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


Related Discussions:- Function ismember - set operations

Highway maintenance, Various types of Bituminous Course? Explain each

Various types of Bituminous Course? Explain each

System engineering approches, how todays manufacturing industry lagging wit...

how todays manufacturing industry lagging with system engineering approaches

Local attraction, how can we find local attraction correction?

how can we find local attraction correction?

Metal cutting tool, how to design a circural form tool on drawing sheet?

how to design a circural form tool on drawing sheet?

Write a program to find the area under the curve y =, #questiWrite a progra...

#questiWrite a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two point

Structural, what is covered un this field?

what is covered un this field?

FI560, Each student will, as part of the course requirements, submit a rese...

Each student will, as part of the course requirements, submit a research paper on an individual stock. You are allowed to select any stock that trades on the New York Stock Exchang

Industrial buildings inspections-fire protection engineering, Industrial Bu...

Industrial Buildings Inspections: Fire safety within industrial buildings falls largely within the scope of more general precautions and recommendations given in Chapter of NF

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd