Message-ID: <1303142778028-3457963.post@n4.nabble.com>
Date: 2011-04-18T16:06:18Z
From: Philippe Massicotte
Subject: Avoiding loop
Hi everyone.
I'm using matrix product such as :
#Generate some data
NCols = 5
NRows = 5
A = matrix(runif(NCols*NRows), ncol=NCols)
B = matrix(runif(NCols*NRows), ncol=NCols)
#First calculation
R = A%*%B
for(i in 1:100)
{
R = R%*%B
}
I would like to know if it was possible to avoid the loop by using something
like mapply or anything else.
Tx in advance,
Phil
--
View this message in context: http://r.789695.n4.nabble.com/Avoiding-loop-tp3457963p3457963.html
Sent from the R help mailing list archive at Nabble.com.