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

Bonds, Objective: Students should familiarize themselves with bonds and/or ...

Objective: Students should familiarize themselves with bonds and/or preferred stock as an investment opportunity and as a source of funds. In this assignment students will determin

Four stroke diesel engine, FOUR STROKE DIESEL ENGINE: T he cycle of ev...

FOUR STROKE DIESEL ENGINE: T he cycle of events that takes place in a four -stroke diesel engine has been shown. Unlike the petrol which drawn in a mixture of air and petrol,

Instruction set, compare zero- one- two- and three-address machines by writ...

compare zero- one- two- and three-address machines by writing programs to compute X=(A+B*C)/(D-E*F)

Evolutionary methods, Evolutionary Methods Optimization methods base...

Evolutionary Methods Optimization methods based upon natural or biological processes Need to be able to parameterise a solution and determine a cost function (good or bad

Installation of propeller, INSTALLATION OF PROPELLER The method of inst...

INSTALLATION OF PROPELLER The method of installation will depend on the type of propeller, and all instructions detailed in the appropriate AMM should be carefully followed; th

Financial management, The role of financial managers in the changing econom...

The role of financial managers in the changing economic scenario

Mass Balances, Engineers sometimes add chlorine to pipes to disinfect water...

Engineers sometimes add chlorine to pipes to disinfect water. It is desired to achieve four logs of kill. This means that the effluent concentration of microoganisms is 10^-4 times

Is the dividend paid on common stock taxable to shareholders, Is the divide...

Is the dividend paid on common stock taxable to shareholders? The results paid on common inventory are taxed on two stages in the U.S. First at the company stage, as a results c

Engine cycles, ENGINE CYCLES The two commonly used cycles on which th...

ENGINE CYCLES The two commonly used cycles on which the I.C. engines operate are: 1Otto cycle.         2 Diesel cycle. 1 OTTO CYCLE: theoretical Otto cycle is shown i

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