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

Agricultural engineering , Agricultural engineering does not easily mean on...

Agricultural engineering does not easily mean only fruits and vegetables formed from the fields. Agriculture has come up with a dissimilar  look now. When you open a paouch of chip

Probabilistic analysis - fire risk assessment , Probabilistic analysis - Fi...

Probabilistic analysis - Fire risk assessment: Probabilistic analysis relies on data and data comes from experience.  The broader the experience, the larger the data source an

Aircraft engine, what is the basic operation of gas turbine engine?

what is the basic operation of gas turbine engine?

C programming fork() dub2(), develop a C program for Linux called pipes.c t...

develop a C program for Linux called pipes.c that does the following: In the main() function, it creates a pipe using the pipe() function, then creates two child processes with for

Polymorphism, Q.  Define the polymorphism. Ans. POLYMORPHISM: It is d...

Q.  Define the polymorphism. Ans. POLYMORPHISM: It is defined as the change in atomic structure which occurs at a definite transformation temperature. The cooling diagram of

Risk management, discuss the value of risk analysis and how the process can...

discuss the value of risk analysis and how the process can be used t derive project management decisions under conditions of uncertainty

3d sketch , I am a chemical engineering foundation year. I need your help ...

I am a chemical engineering foundation year. I need your help with my homework, its 3D sketch by using Google sketchup program?? I have not use it before. Or any other 3D sketch p

Finance choice, Question #1 Which of the following statements is false? ...

Question #1 Which of the following statements is false? A) For corporations, interest paid on its debt is a tax deductible expense. B) For corporations, dividend paid on its

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