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

Hoppala, Please help me to compare the minimum cell cost method and Vogel''...

Please help me to compare the minimum cell cost method and Vogel''s approximation method to find initial basic solution. Generally the sources indicated that the Vogel''s method gi

Evolutionary growth approach, Evolutionary Growth Approach Mimic how bo...

Evolutionary Growth Approach Mimic how bones / plant roots add material to regions under high stress and reduce material where there is small stress • Apply load to structure

Assignment on risk and return, Assignment on Risk and Return# Stock has bet...

Assignment on Risk and Return# Stock has beta of 1.5 & an expected return 11%. A risk free asset earns 2%. Determine the expected return on a portfolio that is equally invested in

Biomediacl instrumentation, Design a dc-coupled one op amp circuit that wil...

Design a dc-coupled one op amp circuit that will amplify the 100uV EOG to have the maximal gain possible without exceeding the ttypical guarenteed linear outpt range.

Basic principles - propeller, BASIC PRINCIPLES : The purpose of a prope...

BASIC PRINCIPLES : The purpose of a propeller is to convert the power developed by the engine into a useful force called 'Thrust'. This force must be equal to and opposite in

Java, 2. Differentiate between stream oriented and data gram oriented socke...

2. Differentiate between stream oriented and data gram oriented socket in java?

Turbine cooling - aircraft engine, Turbine cooling  Airflow: Figure ill...

Turbine cooling  Airflow: Figure illustrates the turbine cooling airflow of a typical gas turbine engine. The outward flow of cooling air is controlled by air seals of multi-g

End centered tetragonal lattice in the bravis list, Q.  There is no end ce...

Q.  There is no end centered tetragonal lattice in the bravis list, but there is an end centered orthorhombic lattice. Explain why this is so? Ans.  A tetragonal system is

Industrial &production engneering, what type of topic or subject is gud for...

what type of topic or subject is gud for the project before the final year project

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