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

Guidance control system, Guidance Control system The control aspect...

Guidance Control system The control aspect of the guidance system is intended to stabilise the behaviour of the airframe.  The fact that the guidance system will always h

Hardness of water, why is only 1 lime and sod required for aluminium impuri...

why is only 1 lime and sod required for aluminium impurities

Mechanics, an electric bulb weighing 15n hangs from a point C by 2 strings ...

an electric bulb weighing 15n hangs from a point C by 2 strings AC and BC .string AC is inclined at 60degree to horizontal and BC at 45 degree to vertical.find tension in string.

Identify people at risk - fire risk assessment, Identify people at risk: ...

Identify people at risk: It is often easy to forget that there may be people in a building who cannot move as quickly as the rest of us.  They may be in a wheel chair, they ma

Homework, name the functions of the CIPM

name the functions of the CIPM

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

Zener diode, easy defination of zener diode nd its application and characte...

easy defination of zener diode nd its application and characteristics ?

Survey, Operations invending in chain survey

Operations invending in chain survey

Electro slag welding process, Q. Describe the electro slag welding process....

Q. Describe the electro slag welding process.                                                   OR        Describe electro slag welding process. What are the speci

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