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

Radar systems, Radar Systems Radar is an acronym for RAdio Detection...

Radar Systems Radar is an acronym for RAdio Detection And Ranging.  A radar uses an antenna to transmit a series of electromagnetic waves or pulses, and an antenna (usual

Ingredients of moulding components, Q. What are the ingredients of moulding...

Q. What are the ingredients of moulding components? Ans. Polymer Additives: One or more of the following materials are added to the polymers, either before or during poly

Dynamic model of pitching motion , It is instructive to investigate the pit...

It is instructive to investigate the pitching motion caused by a disturbance from trim due to a control surface deflection. We shall assume that the velocity remains constant, and

#friction, the crate has a mass M and is subjectedto towing P acting at an ...

the crate has a mass M and is subjectedto towing P acting at an angle t1 with the horizontal.if the coefficient of static friction is k,determine the magnitude of p to just start

Tube drawing, Drawing operation can also be used for reducing the tube cros...

Drawing operation can also be used for reducing the tube cross-section. The drawing equipment consists of draw bench and die. One end of the tube is pulled through the die over a f

Modulus of rupture, description about modulus of rupture machine & differen...

description about modulus of rupture machine & different parts of bending strength machine

Sonic airflow - aircraft maintenance, Sonic airflow though divergent and co...

Sonic airflow though divergent and convergent ducts When a flow of fluid (i.e. gas) flows at sonic speed through a convergent duct a shock wave forms at the exit area of the du

Y 4 u, Ask questioy 4 men #Minimum 100 words accepted#

Ask questioy 4 men #Minimum 100 words accepted#

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