Please enable JavaScript to view this site.

Knowledge Base

Returns an array containing all the unique values in a matrix. In other words, this command returns all the elements in a matrix without repeating them if they appear more than once in the matrix.

 

Supported Product: FDTD, MODE, DEVICE, INTERCONNECT

 

Syntax

Description

out=unique(a);

Returns an array containing containing all unique values in the matrix a.

 

Example

Define a matrix containing elements that are repeated and print out all the values without repetition.

# define a matrix a

a = [0,0,0;

 1+1i,0,0;

 1,1,0;

 0.25,.25,0;

 0.8,.25,0;

 0.25,.8,0;

 0.25,.25,1];

 

# print unique values to script prompt

?unique(a);

 

result: 

0+0i 

0.25+0i 

0.8+0i 

1+0i 

1+1i

 

 

See Also

Functions, uniquevertices

Copyright Lumerical Inc. | Privacy | Site Map