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

Crude oil assy, what is the importance of cetane number in crude oil assy?

what is the importance of cetane number in crude oil assy?

Propeller terminology, PROPELLER TORQUE Propeller torque is produced by...

PROPELLER TORQUE Propeller torque is produced by the aerodynamic drag on the blades when in motion. Propeller torque acts in the plane of rotation and opposes engine torque.

Radar engineering, Calculate the maximum range when radar operates at 10GHz...

Calculate the maximum range when radar operates at 10GHz and has peak power=10 Mwatt,S/N ratio=10dB,antenna cross section=100 mm2,target cross section=10mm2.The gain of transmittin

Wing design for a sports glider , Wing design for a sports glider  Th...

Wing design for a sports glider  The justification of the aerofoil selection with appropriate data, based on tunnel work or computational analysis.  Sizing of the wing in

Compressor, from suction side oil comes out

from suction side oil comes out

Aviation legislation - dealer’s certificate , DEALER'S CERTIFICATE Refere...

DEALER'S CERTIFICATE Reference: When the sale of an aircraft involves flight without a Certificate of Registration, The C.A.A. will permit the aircraft to fly under certain re

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

Normal spectrum, Q. What is a normal spectrum? Show that grating spectrum i...

Q. What is a normal spectrum? Show that grating spectrum is a normal spectrum. Ans. Normal spectrum and the dispersive power of grating is defined as the rate of change of a

Engineering science , the axle diameters of differential wheel and axle lif...

the axle diameters of differential wheel and axle lifting machine are 254mm and 129mm respectively.the load has a mass of 36kg and the effort required is 300N.if the efficiency is

Thermodynamics of materials, outline five (5) areas where thermodynamics ca...

outline five (5) areas where thermodynamics can be applied in materials engineering

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