test_Table_extractMahalanobisWhere.praat 967 B

1234567891011121314151617181920212223242526272829303132
  1. # test_Table_extractMahalanobisWhere.praat
  2. # djmw 20140509
  3. appendInfoLine: "Table_extractMahalanobisWhere test"
  4. t = Create Table with column names: "t", 1000, "f x y"
  5. Formula (column range): "f", "f", "randomInteger (1,1)"
  6. Formula (column range): "x", "y", "randomGauss (self[1],0.1)"
  7. tm = Extract rows where (mahalanobis): "x y", "greater than", 3, "f", "1"
  8. tm1 = Extract rows where: "self$[""f""]=""1"""
  9. nm1 = Get number of rows
  10. selectObject: t
  11. t1 = Extract rows where: "self$[""f""]=""1"""
  12. t1m1 = Extract rows where (mahalanobis): "x y", "greater than", 3, "", "1"
  13. n1m1 = Get number of rows
  14. assert nm1 = n1m1
  15. # only for interactive use
  16. ; @draw
  17. procedure draw
  18. Erase all
  19. selectObject: t
  20. Select outer viewport: 0, 6, 0, 6
  21. Scatter plot: "x", 0, 4, "y", 0, 4, "f", 10, "yes"
  22. Colour: "Red"
  23. Draw ellipses: "x", 0, 4, "y", 0, 4, "f", 3, 12, "no"
  24. Colour: "Black"
  25. endproc
  26. removeObject: t, tm, tm1, t1, t1m1
  27. appendInfoLine: "Table_extractMahalanobisWhere test OK"