Current location - Training Enrollment Network - Mathematics courses - How to calculate multiplication and addition of two-dimensional array with C language? Please give an example and talk about the conditions of use. thank you
How to calculate multiplication and addition of two-dimensional array with C language? Please give an example and talk about the conditions of use. thank you
In mathematics, a matrix is a two-dimensional array after all. A matrix with n rows and m columns can be multiplied by a matrix with m rows and p columns, and the result is a matrix with n rows and p columns, in which the number in the position of the I-th row and J-th column of the previous matrix is equal to the sum of all M products after the corresponding multiplication of the M-th number in the I-th row and J-th column of the next matrix. For example, the following formula indicates that a matrix with 2 rows and 2 columns is multiplied by a matrix with 2 rows and 3 columns, and the result is a matrix with 2 rows and 3 columns.

03 1? 13? 0* 1+3*0? 0* 1+3*(-2)? 0*3+3*(- 1)0? -6? -3

62? *{? 0-2- 1? }=? {? 6* 1+2*0? 6* 1+2*(-2)? 6*3+2*(- 1)}={? 62 16}