help
If your matrices are the same size, you can just add them. If they aren't the same size, I'm not sure what you are trying to accomplish.
mat1 <- matrix(1:9, nrow=3) mat1
[,1] [,2] [,3] [1,] 1 4 7 [2,] 2 5 8 [3,] 3 6 9
mat2 <- matrix(runif(9), nrow=3) mat2
[,1] [,2] [,3] [1,] 0.54837515 0.3476839 0.6298484 [2,] 0.25790633 0.3394281 0.3601670 [3,] 0.08251705 0.2288201 0.4216952
mat1 + mat2
[,1] [,2] [,3] [1,] 1.548375 4.347684 7.629848 [2,] 2.257906 5.339428 8.360167 [3,] 3.082517 6.228820 9.421695
On Thu, May 21, 2009 at 11:08 AM, daniele riggi <daniele.riggi at gmail.com> wrote:
Someone knows the existence of a function to sum the elements of the same place A[i,j] B[i,j] of a matrix?thank you
Sarah Goslee http://www.functionaldiversity.org