Well, you're rather stuck writing them all out unless you have them in
some other data structure.
## three dimensional array (50 4 x 4 matrices)
x <- array(rnorm(16 * 50), dim = c(4, 4, 50))
> apply(x, 1:2, mean)
[,1][,2] [,3][,4]
[1,] -0.09460574 0.01572077 -0
What if you have over 50 matrices and you don't want to write them all out
one-by-one? I know there's something really quite simple, but I haven't
found it yet!...
--
View this message in context:
http://r.789695.n4.nabble.com/Average-of-Two-Matrices-tp860672p4126615.html
Sent from the R help m
Hi, Gundala
pretty much u can do is adding them directly , that is , treat them
like two numbers instead of matrix.
z <- (x+y)/2 .
Is that what u want ? or u have another meaning.
regards
On 2008-6-25, at 上午10:19, Gundala Viswanath wrote:
Hi,
I have two matrices x and y (same dimen
What about z <- (x + y) / 2
Gundala Viswanath wrote:
Hi,
I have two matrices x and y (same dimensions).
How can I compute the average of "x" and "y" for each coordinate
to form a new average matrix "z" ?
- Gundala Viswanath
Jakarta - Indonesia
__
Hi,
I have two matrices x and y (same dimensions).
How can I compute the average of "x" and "y" for each coordinate
to form a new average matrix "z" ?
- Gundala Viswanath
Jakarta - Indonesia
__
R-help@r-project.org mailing list
https://stat.ethz.ch/ma
5 matches
Mail list logo