Home > Extreme Optimization Mathematics Library for .NET > Reference > Extreme.Mathematics.LinearAlgebra Namespace > Matrix Class > Methods


Extreme Optimization Mathematics Library for .NET

Matrix.Subtract Method 

Subtracts two Matrix objects.

[Visual Basic]
Public Shared Function Subtract( _
   ByVal matrix1 As Matrix, _
   ByVal matrix2 As Matrix _
) As Matrix
[C#]
public static Matrix Subtract(
   Matrix matrix1,
   Matrix matrix2
);

Parameters

matrix1
The first Matrix.
matrix2
The second Matrix.

Return Value

A Matrix that is equal to the matrix matrix1 minus the matrix matrix2. A Matrix that is the sum of the specified form of this matrix and the matrix matrix2.

Exceptions

Exception TypeCondition
DimensionMismatchExceptionThe dimensions of this instance and the matrix matrix2 are not compatible for the specified operation.
DimensionMismatchExceptionThe number of rows of matrix1 does not equal the number of rows of matrix2
-or- The number of columns of matrix1 does not equal the number of columns of matrix2.

See Also

Matrix Class | Extreme.Mathematics.LinearAlgebra Namespace