This is machine translation

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

uminus, -




C = -A negates the elements of A and stores the result in C.

C = uminus(A) is an alternative way to execute -A, but is rarely used. It enables operator overloading for classes.


collapse all

Create a 2-by-2 matrix, A.

A = [1 -3; -2 4]
A =

     1    -3
    -2     4

Negate the elements of A.

C = -A
C =

    -1     3
     2    -4

Input Arguments

collapse all

Input array, specified as a scalar, vector, matrix, or multidimensional array. A can be a numeric array, logical array, character array, duration array, or calendar duration array.

Complex Number Support: Yes

More About

collapse all

Tall Array Support

This function fully supports tall arrays. For more information, see Tall Arrays.

See Also


Introduced before R2006a

Was this topic helpful?