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

representing vectors in different axes, Representing vectors in different ...

Representing vectors in different axes All positions, velocities, momentums and accelerations are really relative positions, relative velocities, relative momentums and relativ

Help please, Judy Johnson is choosing between investing in two Treasury sec...

Judy Johnson is choosing between investing in two Treasury securities that mature in five years and have par values of $1,000. One is a Treasury note paying an annual coupon of 5.

Hydro plant, various components used in plants

various components used in plants

Mobile Communication, A car, moving in the south-east direction at a veloci...

A car, moving in the south-east direction at a velocity of 5 m/s, receives a ray of power of -120 dBm each from the north, east and west. The carrier frequency is 300 MHz. (i) Sket

The impact and post-impact behaviour of composites , The Impact and Post-im...

The Impact and Post-impact Behaviour of Composites  Many early studies involved doing Charpy tests on small notched samples. This is a destructive test of impact resistance, co

Nozzle guide vane inspection, Nozzle Guide Vane Inspection: Inspection ...

Nozzle Guide Vane Inspection: Inspection of the NGVs is possible using a strong light source and mirror, it is more probable however that a boroscope inspection will be require

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