Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #test case:
  2. library(emdist)
  3. Rows = 40
  4. Cols = 40
  5. Mat1 = matrix(
  6. seq(1,Rows*Cols),
  7. nrow = Rows,
  8. ncol = Cols)
  9.  
  10. m0 <- matrix(0, Rows, Cols)
  11. Mat_Rand = apply(m0, c(1,2), function(x) rnorm(1)) #sample(c(0,1),1))
  12. Mat2 = Mat1 * Mat_Rand
  13.  
  14. emd2d(Mat1,Mat2,dist="euclidean")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement