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

Circuit, in the circuit what is the voltage at point with respect to ground...

in the circuit what is the voltage at point with respect to ground

Explain the concept of error function, Question 1 Explain the concept of e...

Question 1 Explain the concept of error function Question 2 Obtain the Fourier transform for the following Single sided exponential signal Gate function Triangula

Electro-mechanical fuel control, Electro-mechanical fuel control: The s...

Electro-mechanical fuel control: The start fuel valve and ignition are energised as soon as rotation (3%) is sensed by an Electronic Sequence Unit (ESU). At 14% and with risin

Avionic systems design- static stability derivatives, Static stability der...

Static stability derivatives Static stability requires that a restoring action to any motions caused by forces and moments is auto-matically produced along and about the same a

Strength of materials, Applications of the subject strength of materials

Applications of the subject strength of materials

Dynamic balancing principles - aircraft maintenance , Dynamic balancing pri...

Dynamic balancing principles: We must all be familiar with the effects of unbalance in one form or another, but perhaps the most common effect is that arising from wheel unbala

Quality assurance, Graduate project in the field of quality assurance

Graduate project in the field of quality assurance

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