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

Bragg''s law and calculation of wavelength, Q.   Explain Bragg's law. A mon...

Q.   Explain Bragg's law. A monochromatic X-ray is incident on a crystal. By rotation the crystal, two successive reflections are obtained at angles of 10.0° and 23.0°. the inter p

The ideal operational amplifier, THE IDEAL OPERATIONAL AMPLIFIER Althou...

THE IDEAL OPERATIONAL AMPLIFIER Although the characteristics of an ideal operational amplifier are unattainable, modern integrated circuit types can provide an extremely close

Materials, Why Industries that manufacture racing cars prefers nickel based...

Why Industries that manufacture racing cars prefers nickel based alloys for engine components and iron based alloys for structural parts?

Area and voume by contour, what do you know about area and volume by contou...

what do you know about area and volume by contour?explain

Analyze an organization''s competition, Briefly explain how to analyze an o...

Briefly explain how to analyze an organization''s competition Answer: In order to analyze an organization’s competition, the following aspects need to be checked and recorded in o

Energy emission per capita, How do the numbers calculated in f. and g. comp...

How do the numbers calculated in f. and g. compare to the values in California and in the USA? The source of CO 2 emissions in Florida differ a lot from California. Transportat

Telecommunication Networks., Hi there, I''ve sent an email to you guys abou...

Hi there, I''ve sent an email to you guys about Telecommunication Networks assignment and I haven''t yet received any reply. Pleases let me know if you have received it. Thank yo

Electronics, explain compensated semiconductors

explain compensated semiconductors

Level indicator., i have a project to be completed, the project is, How to ...

i have a project to be completed, the project is, How to make a device which warns you when your water reservoir is full?? i want the name of device needed and the way to complete

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