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

Aviation legislation - dealer’s certificate , DEALER'S CERTIFICATE Refere...

DEALER'S CERTIFICATE Reference: When the sale of an aircraft involves flight without a Certificate of Registration, The C.A.A. will permit the aircraft to fly under certain re

Heat transfer, #questionA piece of Al weighing 6 kg and initially at a temp...

#questionA piece of Al weighing 6 kg and initially at a temperature of 300OC is suddenly immersed in a fluid at a temperature of 20OC. The convectice heat transfer coefficient is 5

Barometric lag, My question is that i am working in a petrochemical plant w...

My question is that i am working in a petrochemical plant where in final stage disc ring reactor the barometric lag is chocked completely the system is under vacuum if i introduce

Propeller governing mode, Propeller governing mode: The speed lever is ...

Propeller governing mode: The speed lever is placed in the high position. The engine is operating at 97 percent. As the power lever is advanced ahead of the flight idle deten

Trigonometry( bearings and rectilinear figures), a pilot entering a bay on ...

a pilot entering a bay on course 60.3 degrees at speed 12 miles per hour sees a light bearing 37.3 true and 20 minutes later he sees it bearing 20.0 degrees true. if he keeps the

Vlsi, how to find out the number of select lines while construcing a mux or...

how to find out the number of select lines while construcing a mux or a demux logic diagram?

Water haedness, hardness of bore well water is less than sea water

hardness of bore well water is less than sea water

Divided entrance duct - aircraft engine, Divided entrance duct On a sin...

Divided entrance duct On a single engine aircraft with fuselage mounted engines, either a wing root inlet or a side scoop inlet may be used. The wing root inlet presents a pro

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