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

Control surfaces , Control Surfaces  As with a flight control system...

Control Surfaces  As with a flight control system, a guidance algorithm uses control surfaces to control the behaviour of an airframe.         - Rudder, ailerons, elev

Homework, name the functions of the CIPM

name the functions of the CIPM

System architecture and design, The home work is to make an model based sys...

The home work is to make an model based system architecture for an electrical car. in Enterprise Architecture with SysMl language.

Risk Analysis, how would I find assistance with such toics as: probability ...

how would I find assistance with such toics as: probability assessment methods, risk modeling, stochatic dominance and multi-attribute methods?

Spot welding, In spot welding, the parts to be joined are normally over lap...

In spot welding, the parts to be joined are normally over lapped. The work piece are clamped between two water cooled copper electrodes. On the passage of a high transient current,

Resolving power and rayleigh criterion of resolution, Q. Explain Rayleigh c...

Q. Explain Rayleigh criterion of resolution. What is meant by resolving power of grating? Ans.   Resolving Power (i)  Meaning of Resolution : The resolving power of

Engine PW4168 or PW4168A, How is the overspeed solenoid cutback valve opera...

How is the overspeed solenoid cutback valve operate when Engine overspeed happen?

Engineering physics(find wavelenth of light), Interference fringes are prod...

Interference fringes are produced by fresnel''s biprism in the focal plane of an eyepiece 200 cm away from the slit.Two images of the slit that formed each of the two positions of

Sprag clutch - aircraft engine, Sprag Clutch : Sprag clutches are used ...

Sprag Clutch : Sprag clutches are used to provide the disconnect mechanism between the starter motor and the engine. The clutch will transmit drive from the starter motor, but

Multirate filters, obtain the polyphase structure H(Z)=1-3Z^-1/1+4Z^-1

obtain the polyphase structure H(Z)=1-3Z^-1/1+4Z^-1

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