public static T[,] MatSum<T>(T[,] a, T[,] b) where T: INumber<T>
{
if (a.GetLength(0) != b.GetLength(0) || a.GetLength(1) != b.GetLength(1))
throw new ArgumentException("The matrices are non-conformal");
for (int i = 0; i < a.GetLength(0); i++)
for (int j = 0; j < a.GetLength(1); j++)
a[i, j] += b[i, j];
return a;
}
Буду рад помощи