Displaying 1 result from an estimated 1 matches for "tp4643946p4644010".
2012 Sep 23
3
Confused by code?
x<-matrix(c(1,0,0,0,1,0,0,0,1),nrow=3)
> y<-matrix(c(0,0,0,1,0,0,1,1,0),nrow=3)
> z<-matrix(c(0,1,0,0,1,0,1,0,0),nrow=3)
> x[z]<-y[z]
The resultant matrix x is all zeros except for the last two diagonal cells
which are 1's.
While y is lower triangualr 0's with the remaining cells all ones.
I really don't understand how this deceptively simple looking piece of