Previous Page Next Page Contents

listlib::removeDupSorted -- remove duplicates of any element from ordered lists

Introduction

listlib::removeDupSorted(list) removes all duplicates of any element of the ordered list list.

Call(s)

listlib::removeDupSorted(list)

Parameters

list - an ordered MuPAD list

Returns

a list that contains every element only once

Related Functions

listlib::removeDuplicates

Details

Example 1

listlib::removeDupSorted removes all duplicates from the given list:

>> listlib::removeDupSorted([1, 1, 1, 3, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7])
                               [1, 3, 5, 7]

If the list is not ordered, listlib::removeDupSorted fails:

>> listlib::removeDupSorted([1, 3, 5, 7, 1, 3, 5, 7, 1, 3, 5, 7])
                   [1, 3, 5, 7, 1, 3, 5, 7, 1, 3, 5, 7]

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000