using MathNet.Numerics.LinearAlgebra; // Create a 2x2 matrix IMatrixmatrix = DenseMatrix.OfArray(new double[,] { { 1, 2 }, { 3, 4 } });
using MathNet.Numerics.LinearAlgebra; // Create two 3x3 matrices IMatrixIn this example, we create two 3x3 matrices and then use the * operator to multiply them together. The resulting matrix is also a 3x3 matrix. Package library: MathNet.Numerics.LinearAlgebra.matrix1 = DenseMatrix.OfArray(new double[,] { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } }); IMatrix matrix2 = DenseMatrix.OfArray(new double[,] { { 9, 8, 7 }, { 6, 5, 4 }, { 3, 2, 1 } }); // Multiply the two matrices IMatrix result = matrix1 * matrix2;