search for: matrixallo

Displaying 1 result from an estimated 1 matches for "matrixallo".

2011 Jan 27
1
subloop - flexible coding - variable number of loops
...a general code for every n (n from 1 to 10). I tried a lot of things, but I always got stuck with the number of subloops or witch closing the brackets. Any suggestions? Cheers, Peter Department of Mathematics and Statistics University of Canterbury New Zealand n <-2 matrixallo <- matrix(nrow=0,ncol=n) for(i in 1:20) { for (j in 1:20) { if (i+j == 20) { newentry<- cbind(i,j) matrixallo <- rbind(matrixallo,newentry) } } } n <-3 matrixallo <- matrix(nrow=0,ncol=n)...