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

What are the elements limiting higher data rate in networks, Question: ...

Question: (a) What are the elements limiting high data rate in cellular networks? (b) Describe the following characteristics of 4G mobile networks: - Always on - RAN A

Life cycle of a product from raw materials, The Task: This project is a...

The Task: This project is a 50% of the whole assessment of the course. You are required to assess a life cycle of a product from raw materials, through the supply chain, manufa

Various stages of creep, Q. Explain various stages of creep? Ans. CREE...

Q. Explain various stages of creep? Ans. CREEP: Creep can be defined as the process by which plastic flow occurs when a constant stress or load is applied to a material for a

Need answers in an excel spreadsheet, 1 Scott Investors, Inc., is consideri...

1 Scott Investors, Inc., is considering the purchase of a $447,000 computer with an economic life of five years. The computer will be fully depreciated over five years using the st

Shelf list filing - library management, Shelf List Filing   Shelf list ...

Shelf List Filing   Shelf list reflects the arrangement of documents in the library. That is to say, the classificatory arrangement of the documents in a library can be seen th

Basic electronics, A car battery is of 12 v. eight dry cells of 1.5 v each ...

A car battery is of 12 v. eight dry cells of 1.5 v each connected in series can give 12 v. but such cells are not used in starting a car. why?

Refractory and their classification, Q. What are refractory's? How are they...

Q. What are refractory's? How are they classified? Give the essential requirements of good refractories.                                                    OR Discuss cla

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

Reduction gearing in aircraft engine , Reduction Gearing : Compound epi...

Reduction Gearing : Compound epicyclic reduction gears enable a greater reduction in speed to be obtained without resorting to larger components. They may be of either the fix

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