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

Process control, what is the input to a process control system?

what is the input to a process control system?

How does or gate work, Expertsmind.com  brings you unique solution in Elec...

Expertsmind.com  brings you unique solution in Electrical Engineering   How does OR gate work? An 'OR' gate is like two or more switches positioned in parallel.

Oil pumps - aircraft engine, OIL PUMPS The oil pumps fitted in a recirc...

OIL PUMPS The oil pumps fitted in a recirculatory system are normally gear-type or Gerotor type pumps. The pumps are usually mounted in a pack containing one pressure pump and

Irr, How do you calculate IRR

How do you calculate IRR

Constant speeding propeller, Constant speeding propeller: The definitio...

Constant speeding propeller: The definition of a Constant Speeding propeller is 'A propeller, the pitch setting of which varies automatically to maintain a preselected constant

Extrusion, Extrusion : In this method of forging, the metal slug is forced...

Extrusion : In this method of forging, the metal slug is forced to pass through a die under the action of intense of hydraulic pressure. The process can be viewed as squeezing the

Mine Surveying.., Question 1 (100 marks) As Surveyor in charge of an underg...

Question 1 (100 marks) As Surveyor in charge of an underground mine you have been instructed to design a tunnel to join a crosscut to a haulage drive. The details of the crosscut a

Open innovation, is there any open innovation engineering web portal in ind...

is there any open innovation engineering web portal in india

Secondary operations in powder metallurgy methods, Q. What are the secondar...

Q. What are the secondary operations we apply in powder metallurgy methods. Give their use also. Ans. Secondary Processes of Manufacture : In addition to the basic proce

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