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

Cro, derive the expression of deflection of beam in CRO

derive the expression of deflection of beam in CRO

Difference between fin and swell, Difference Between Fin and Swell    ...

Difference Between Fin and Swell          Swell : The unintentional bulges found on the casting surfaces are known as swells. Such enlargements on the casting surface are cau

Software design principles, explain the design should be traceable to the a...

explain the design should be traceable to the analysis model

Net present value method: npv, Discounted cash flow methods Net present val...

Discounted cash flow methods Net present value method: NPV It is one of the classic methods of evaluating the investment project. Here each potential projects value is find out its

Salvage value Terminal cash flows, Terminal cash flows Salvage value Sal...

Terminal cash flows Salvage value Salvage value (SV) is the most common example of terminal cash flows. Salvage value may be defined as the market price of an investment at the

Describe any three properties of mortars, QUESTION 1 a) Describe any th...

QUESTION 1 a) Describe any three properties of Mortars b) Each combination of coarse and fine aggregates has a specific water demand for a given mix fluidity or slump. What

Roll-compacting, Q. Describe the continuous production of metal strip by ro...

Q. Describe the continuous production of metal strip by roll compacting of powder. Differentiate between impregnation and infiltration. Ans. Roll-compacting : It is the

What is call option?, What is Call Option? Calls give the client the rig...

What is Call Option? Calls give the client the right but not the responsibility to buy a given variety of the actual resource, at a given cost on or before a given upcoming time

Principal of assembly buildings- fire protection engineering, Principal of ...

Principal of Assembly buildings- fire protection engineering: As assembly buildings accommodate members of the public they often accommodate people with disabilities. People

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