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

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

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Member of the sets class.

Syntax

c = intersect(a, b)

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

[c, d, e] = intersect(a, b)

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

Description

Computes the intersection of sets.

Examples

Inputs

Name Description
a Specifies a vector or matrix.
b Specifies a vector or matrix.
'rows' Specifies that c returns the rows that are in both a and b if a and b are matrices with the same number of columns.

Outputs

Name Description
c Returns in ascending order all the elements in both a and b. c is a vector or matrix.
d Returns the indexes of the elements in a that are in c. d is a vector of integers.
e Returns the indexes of the elements in b that are in c. e is a vector of integers.

Examples

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

Related Topics

ismember
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