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

Armature cipl, in which type of armature winding Equaliser ring dummy coils...

in which type of armature winding Equaliser ring dummy coils are used

Ewing’s molecular theory of magnetism, Ewing’s molecular theory of magnetis...

Ewing’s molecular theory of magnetism   Every molecule of a magnetic substance behaves as a tiny magnet called molecular magnet. In an unmagnetized state the molecular m

Linear integrated circuit, ac analysis for dual input unbalanced output dif...

ac analysis for dual input unbalanced output differntial amplifier

Highway maintenance, Various types of Bituminous Course? Explain each

Various types of Bituminous Course? Explain each

Solvency ratios and profitability ratios, Solvency Ratios: Profitability R...

Solvency Ratios: Profitability Ratios: The profitability ratios determine the capacity of the company to generate the profits with the amount of shareholders investment. Again hig

Risk and return, if we are comparing the risk and return of two stocks. wha...

if we are comparing the risk and return of two stocks. what to calculate, what to analyza and what conclude

Cold junction compensation, Cold junction compensation A recent solutio...

Cold junction compensation A recent solution to the problem of controlling a reference junction temperature is to use a 'cold-junction compensator'. This is an integrated circu

Core sand, Q.27 Explain the desirable characteristics of core sand. What ar...

Q.27 Explain the desirable characteristics of core sand. What are the normal binders used in core sand ? Types of cores used in foundry. Ans. Core Sand : The core and ma

Secondary operations in powder metallurgy methods, Q. What are the secondar...

Q. What are the secondary operations we apply in powder metallurgy methods. Give their use also. Ans. Secondary Processes of Manufacture : In addition to the basic proce

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