Skip to content

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

complement function

The elements of a list that are in none of the others.

How to write it

complement(all, others, ...)

all
The list to take elements from. Takes a list.
others
A list of elements to leave out. Takes a list.

Examples

  • complement⁡([1,2,3],[2])=[1,3]\displaystyle \operatorname{complement}(\left[ 1, 2, 3 \right], \left[ 2 \right]) = \left[ 1, 3 \right]
    complement([1, 2, 3], [2])

    In the solver, complement([1, 2, 3], [2]) gives [1, 3].

    Open in the solver
  • constant_array

    A list of copies of a value.

  • apply

    Replace the head of an expression, or the brackets of a list, with a function.

  • count

    How many elements of a list equal a value.

  • append

    A list with an element added at the end.

  • dimensions

    The size of a list or a matrix, level by level.

  • accumulate

    Running totals of a list.