Block: Unique

Removes duplicated samples in a signal.

For example, if we have a signal with 8 samples like this one:
1, 3, -4, 8, 3, 4, 1, -3
the block will output a new signal with the folowing samples:
1, 3, -4, 8, 4, -3

Parameters:

SortSamples: If true, the block sorts the samples after remove the duplicated samples. Default value is true.

Example:

The following example shows an usage in C#.

var signal = new ImportFromTextBlock { Text = "1, 3, -4, 8, 3, 4, 1, -3" };
var block = new UniqueBlock
{
    SortSamples = false
};

signal.ConnectTo(block);
signal.Execute();

Console.WriteLine(block.Output[0].ToString(0));
//Output: 1, 3, -4, 8, 4, -3

The above example generates the following set of inputs and outputs:


Last edited Jan 21, 2014 at 1:36 AM by walteram, version 1

Comments

No comments yet.