You're missing the initialization of valuematrix. You can do this through
valuematrix <- list()
just before the for loop.
You might also consider using lapply to solve this problem. It automatically stores the matrices in a list.
y <- matrix(1:300, 100, 3)rep = 200matList <- lapply(1:ncol(y), function(i) replicate(rep, y[,i]))