Excel functions / Math

MUNIT function

The unit matrix of a given size: 1 down the diagonal and 0 everywhere else.

Syntax

=MUNIT(dimension)

Arguments

When to use it

MUNIT gives the unit (identity) matrix of a size: 1 down the diagonal, 0 elsewhere. Multiplying any matrix by it leaves the matrix unchanged.

Examples

  1. A 3 × 3 identity

    ABCDE
    1Size
    23100
    3010
    4001

    In C2: =MUNIT(A2) → 1, 0, 0; 0, 1, 0; 0, 0, 1

    Try this example

Common mistakes

MUNIT in other languages

Excel shows function names in its own language. In these languages it also puts a semicolon between arguments where English has a comma.

Translate a whole formula

Try MUNIT in the playground

Related functions