Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

combinat::subwords

Subwords of a word

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

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?