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

Open innovation, is there any open innovation engineering web portal in ind...

is there any open innovation engineering web portal in india

Inhibit gate, Inhibit Gate Occasionally it is required to 'hold' one in...

Inhibit Gate Occasionally it is required to 'hold' one input to an AND gate at a particular logic level in order to disable the entire gate. One method of representing this sy

Cash Flows Components, A typical investment will have three components of c...

A typical investment will have three components of cash flows: • Initial investment • Annual net cash flows • Terminal cash flows. Initial investment Initial investme

Composition of two simple harmonic motion at straight line, show the practi...

show the practical use of it also descibe it elaborately why it is useful which way we can use it where we use it

Types of patterns in manufacturing, Types of patterns : These  depends upo...

Types of patterns : These  depends upon many factors like the bulk of casting, type of moulding processes, number of castings required and the anticipated difficulty of moulding,

Tig and mig welding techniques, Q. Explain the TIG and MIG systems of arc w...

Q. Explain the TIG and MIG systems of arc welding Give the applications of each.                                                         OR         Explain briefly

Water, Dear Sir, Please answer the follwing question . Specs: Filterati...

Dear Sir, Please answer the follwing question . Specs: Filteration Capacity 18000 LPH , Tested pressure 6Kg/Sq.cm, Vertical MS pressure Sand filter(flat ends 6mm thick & di

Difference between soldering, Q. What are the differences between soldering...

Q. What are the differences between soldering, brazing and welding? Ans. S.No.  Welding Soldering Brazing

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