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

Risk Decomposition, Analyze two stocks from an industry of your choice in t...

Analyze two stocks from an industry of your choice in terms of risk decomposition, specifically portfolio variance eq. You should pick 2 firms that you have a certain degree of fam

Transistor configurations, TRANSISTOR CONFIGURATIONS: Before a transist...

TRANSISTOR CONFIGURATIONS: Before a transistor can be used, it must be connected into an input circuit (by two wires) and an output circuit (two wires).  However, because the t

Calculate pi for infinite series, Write a program to calculate from the i...

Write a program to calculate from the infinite series: Print a table showing the value of approximated by one term, two terms, three terms, four terms, and so on from th

Water treatment plant , i need to design a water treatment plant with raw w...

i need to design a water treatment plant with raw water entering ph of 10 and needs to have a ph of 7 when leaving the treatment process the rate of flow 260lt/sec

Identify the key issues evident at global mining, The atmosphere in the roo...

The atmosphere in the room was tense. Ted Kimoski, Financial Director for Global Mining, had justfinished his presentation. John Campbell, Managing Director, sat quietly making not

Couplings in engine, Couplings: Because of the requirement to make main...

Couplings: Because of the requirement to make maintenance tasks such as engine removal/refit, gearbox removal/refit easier, it is necessary to have a means of coupling the turb

Neutral points of a bar magnet , Fix a drawing paper on a drawing board wit...

Fix a drawing paper on a drawing board with help of drawing pins. Place a magnetic needle on the drawing paper to identify geographical north and south poles. Mark north, sou

Oil pumps, what is the function and location of the components?

what is the function and location of the components?

Swell Factors, The effect of swell factors on volumes

The effect of swell factors on volumes

Propeller terminology, PROPELLER TORQUE Propeller torque is produced by...

PROPELLER TORQUE Propeller torque is produced by the aerodynamic drag on the blades when in motion. Propeller torque acts in the plane of rotation and opposes engine torque.

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