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

Thermodynamics, calculate the workdone by a system which contains 10kg of t...

calculate the workdone by a system which contains 10kg of this gas expanding from 1m^3 at temperature of 293k, use the values a=15.7*10Nm^4, b=1.07*10^-2m^3 , R=0.278KJ/Kg-k.

Foreign exchange market and exchange rates, what is the equation relating t...

what is the equation relating the real exchange rate to the nominal exchange rate and domestic and foreign price levels

Susceptibility - fire safety management, Susceptibility: Susceptibilit...

Susceptibility: Susceptibility to products of combustion, which includes metabolism, lung capacity, pulmonary disease, allergies, or other physical limitations that affect sur

Blow hole and pin hole porosity, Difference between   Blow hole and pin hol...

Difference between   Blow hole and pin hole porosity          Blow hole : They appear as cavities in a casting. When they are visible on the upper surface of the castings, th

Strength of materials, a rectangular beam of size 40mm*60mm is subjected to...

a rectangular beam of size 40mm*60mm is subjected to bending. the maximum bending stress is limited to 75N/mm^2. find the moment of resistance of beam section.

Maintenance of aircraft under “b” conditions, Maintenance of Aircraft under...

Maintenance of Aircraft under “B” conditions:   The maintenance of aircraft flying under "B" conditions must be adequate in relation to the number and duration of the flight

Logic gate -xor gate, 'Exclusive or' gate: The basic OR gate illustrate...

'Exclusive or' gate: The basic OR gate illustrated previously in Figure 3 was seen to include the AND operation in that its output will adopt the 1 state not only when either i

Aerofoil theory and the axial flow compressor, Aerofoil theory and the axia...

Aerofoil theory and the axial flow compressor  The blades of the axial flow compressor are aerofoils and as such behave in a similar way to aircraft mainplanes and propeller bl

Falling weight impact testing , Drop-weight impact towers are frequently us...

Drop-weight impact towers are frequently used to generate low velocity impact damage. Typically, the falling mass will be instrumented, containing a load-cell for measuring the lo

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