combinat::subwords

Subwords of a word

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

combinat::subwords(w)

Description

The function combinat::subwords(w) returns a list of all subwords (sublists) of the list w.

A subword of a word w is a word obtained by deleting the letters at some of the positions in w. A subword is generated as many times as it appears in the word.

To obtain each subword only once, combinat::powerset should be used.

Examples

Example 1

There are 8 subwords of the word [a, b, c]:

combinat::subwords([a, b, c])

Parameters

w

List

Was this topic helpful?