powered by
idxInvert(m, idx)
m <- matrix(1, 5, 5) diag(m) <- 0 m idx <- which(m==0) idx idxInvert(m, idx) idxInvert(5, idx)
Run the code above in your browser using DataLab