Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/articles/c-tutorials/)
-   -   Multiplication of 2 Matrix in C (http://www.go4expert.com/articles/multiplication-2-matrix-c-t1632/)

gavinol 15Jan2011 21:01

Re: Multiplication of 2 Matrix in C
 
Only matrices of the same order (same number of rows and same number of columns) may be added by adding corresponding elements.

Example:

1. [2 -3] [7 3] [2 + 7 -3 + 3] [9 0]


[4 5] + [-2 7] = [4 + (-2) 5 + 7] = [2 12]


[6 0] [1 -5] [6 + 1 0 + (-5)] [7 -5]


2. [2 -3] [7 3 5]


[4 5] + [-2 7 -9]


[6 0] [1 -5 0]
The addition above is undefined since the two matrices do not have the same number of columns.





All times are GMT +5.5. The time now is 14:07.