Function ismember - set operations, Other Engineering

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

Posted Date: 10/22/2012 7:35:05 AM | Location : United States







Related Discussions:- Function ismember - set operations, Assignment Help, Ask Question on Function ismember - set operations, Get Answer, Expert's Help, Function ismember - set operations Discussions

Write discussion on Function ismember - set operations
Your posts are moderated
Related Questions
Fuel Distribution During operation, fuel flows from the aircraft fuel tank to the fuel-pump boost-stage inlet. The pressurised fuel from the boost stage of the engine-driven fu

Assignment Title: Die Press Assembly Drawing The objective of this assignment is to demonstrate the following concepts of design. • Extrude • Revolve • Fillet • Dimensioning • To

what are the manufacturing processes used in cadmium telluride manufacture?

Mode III Interlaminar Fracture Toughness  The Mode III interlaminar fracture toughness of a composite can be measured using the split cantilever beam (SCB) geometry. Here, a c

BURNERS :  ATOMISER BURNERS This type of burner presents the fuel in a finely atomised spray by forcing the fuel to pass through a small orifice. The size of the orifi

Guidance Control system The control aspect of the guidance system is intended to stabilise the behaviour of the airframe.  The fact that the guidance system will always h

These can be divided into several categories. Turbojet engines. The turbojet was the first type of jet engine developed. In this engine all the air passes through the core engin

Framework In the laboratory we will deal with low speed flows, at first using the potential flow solver. We will also investigate behaviour for the NACA 4-series of aerofoils.

WORKING OF I.C. ENGINE Basically there are 2 types of internal combustion engines; the two stoke type and the 4-stroke type. A brief description of these is given below: 1.

The database contains two very simple tables. One holds student information and the other holds assignment grade information. Our goal is to provide a very rudimentary interfa