Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

ismember (MathScript Function) (Windows, Not in Base Package)

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Member of the membership class.

Syntax

c = ismember(a, b)

c = ismember(a, b, 'rows')

[c, d] = ismember(a, b)

[c, d] = ismember(a, b, 'rows')

Description

Determines whether an element in one matrix is an element of another matrix. If you specify 'rows', a and b must have the same number of columns, and ismember(a, b, 'rows') determines whether the rows of a are in b.

Examples

Inputs

Name Description
a Specifies a matrix.
b Specifies a matrix.

Outputs

Name Description
c Returns a matrix of Boolean values. An element in c is 1 if and only if the corresponding element of a is a member of b. Otherwise, the element is 0. c is a matrix of the same size as a. c is a vector or matrix.
d Returns the positions in b of the elements of a. If an element in a is not in b, the corresponding element in d is 0. d is a vector of integers.

Examples

A = [1, 2, 3, 4, 5, 6, 7, 8, 9]
B = [2, 3, 5, 7]
C = ismember(A, B)

Related Topics

intersect
setdiff
setxor
union
unique


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit