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

New assembly buildings - fire protection engineering, N e w Assembly Buil...

N e w Assembly Buildings: 12.1.1.1 The requirements of this chapter shall apply to new buildings or portions thereof used as an assembly occupancy. 12.1.3.2 Simultaneous

Means of escape, Means of escape: The means of escape can start at any...

Means of escape: The means of escape can start at any point inside a building where there may be people.      The means of escape end when 'ultimate safety' is attained out

Calculate the density at maximum flow, (a)  A section of road has a free fl...

(a)  A section of road has a free flow speed of 55km/h and a jam density of 367 vehicles per kilometre. Assuming under a linear speed-density relationship, calculate the density at

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

Interlaminar fracture tests on composite materials , Generally, there are t...

Generally, there are three modes to describe different crack surface displacement in a cracked body. Mode I is opening or tensile mode where the crack surfaces move directly ap

Crystal structure, how can we determine the crystal structure of material b...

how can we determine the crystal structure of material by having interplanar spacing d?

Evolutionary methods, Evolutionary Methods Optimization methods base...

Evolutionary Methods Optimization methods based upon natural or biological processes Need to be able to parameterise a solution and determine a cost function (good or bad

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