anonymous
2008-02-08 00:00:02 UTC
define a function matrixAdd(A,B) that implements the following...
* Create a blank new matrix, initialized to all 0.
* Outer loop to iterate over each row i
* Inner loop to iterate over each column j of row i
* Add the corresponding A[i][j] and B[i][j], and store the sum in the new matrix
* After exiting the outer loop, return the new sum matrix
so far I have this
def matrixAdd(A,B):
m=[[0]*i]*j
for row in range(0,i):
I don't even know if this is right...any help would be greatly appreciated. Thanks.