Debian Codegraph @

dwtest/test_Table_extractMahalanobisWhere.praat

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