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

Explain derivatives in terms of capital markets, Explain derivatives in ter...

Explain derivatives in terms of capital markets The term mixture indicates that it has no separate value that is its value is entirely resulting from the of the actual resources

Finite element analysis, List the advantages disadvantages and applications...

List the advantages disadvantages and applications of FEM?

Duct with flow control-aircraft maintenance, Duct With Flow Control-Aircraf...

Duct With Flow Control-Aircraft maintenance: BERNOULLI'S THEOREM This theorem can be related to the relationship between pressure and velocity existing in the air flowing

Methods of forging, Q. Describe briefly the following methods of forging : ...

Q. Describe briefly the following methods of forging :        (i) Drop forging        (ii) press forging Ans.  (i) Drop Forging: It is also called die

Wet process of manufacturing of portland cement, What are Portland cement a...

What are Portland cement and its composition? Describe the manufacturing process of cement with diagram.  Manufacturing of Portland cement: Dry and Wet Process,  Describe the

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

Software engineering, what is differnce between need and requirement?

what is differnce between need and requirement?

Duty cycle, how to modulate duty cycles

how to modulate duty cycles

Aircraft maintance, Explain different types of intakes of aircraft

Explain different types of intakes of aircraft

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