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

Continuous casting, Continuous Casting : In essential, the process consist...

Continuous Casting : In essential, the process consists of pouring molten metal into a short vertical metal die or mould (at a controlled rate), which is open at both ends, coolin

Metallurgy assignment, Hi I need someone to help me to do a metallurgy assi...

Hi I need someone to help me to do a metallurgy assignment

Discuss the heuristic search as applied to an and/or graph, Question 1 Wha...

Question 1 What is Artificial Intelligence? Discuss the two class of approaches followed for AI Question 2 Discuss the heuristic search as applied to an AND/OR Graph Ques

Guidance systems , The design and implementation of an autonomous guidance ...

The design and implementation of an autonomous guidance system requires knowledge and an understanding of a wide range of technologies, from the physical dynamics of the vehicle (i

Electronics devices and circuits, With the help of circuit diagram and the ...

With the help of circuit diagram and the waveforms,explain the working of a negative clipper with positive biasing voltage.also explain the Same concept in series clipper circuit

Flight dynamics-trim tabs, Trim tabs are small flaps attached to the rear o...

Trim tabs are small flaps attached to the rear of the main control surfaces. They can be adjusted the pilot to reduce the force required to hold the control surface in its deflecte

Aero Performance Problem, Given data for an F-4 (W=40000 lb, S=530 ft^2, Ta...

Given data for an F-4 (W=40000 lb, S=530 ft^2, Ta@sea level=35800 lb, Mach=1.5, h=20000 ft (std day), Cd0=.0224, k=.1516) find aircraft''s specific excess power in straight-and-lev

thermodynamics, Steam enters in the turbine at 6 MPa and 450 deg C and exp...

Steam enters in the turbine at 6 MPa and 450 deg C and expands at some intermediate pressure 60 % of steam is extracted and remainder expands to 10 kPa at this Investigate the effe

Financial Ratio, The following information was extracted from the accountin...

The following information was extracted from the accounting records of De Walt Company as at 28 February 2011 (the end of their financial year): Sales (50% on credit) 1 400 000 Cos

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