search for: xymat

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

Did you mean: mymat
2011 Nov 20
1
place values into a matrix efficiently?
This question attacked me as I was thinking about matrix value updates. I probably will never need to do this, but wanted to ask if there are efficient methods to perform the for-loop in the following sequence. %xymat<-matrix(rep(0,100) nr=10,nc=10) # empty matrix %x<-1:10 %y<-sample.int(10,10,rep=T) %for (j in 1:10) xymat[x[j],y[j]] <- some_function(x[j],y[j]) #to create either false-color or 3D map . plot(0:1,0:1,t='n') % rasterImage(xymat/max(xymat),0,0,1,1,interp=F) This will produce...