The simplest solution would be to add each loop result to a list:
matlist <- list()
for (i in 1:ntime) {
matlist[[i]] = assign(paste0("matrix_out",i), PRECIPITATION[,,i]*mask)
}
Right, I forgot about the matrices saved to the environment. You can eliminate that with:
matlist <- list()
for (i in 1:ntime) {
matlist[[i]] = PRECIPITATION[,,i]*mask
names(matlist)[i] = paste0("matrix_out",i)
}
So the stand-alone matrices are not created
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…