2014-10-30 27 views
0

在Praat中,我需要编写一个脚本,可以创建一个包含多列的表格。然后将数据插入到这些列中。在PRAAT中插入列

请让我知道该怎么做?

回答

0

您可以使用命名为Create Table with column names...的命令创建列名为Table的对象。你给它的对象的名称,行数和一个字符串的名称的列,用空格分隔。

要将值插入表中,您需要将其选中,然后使用Set numeric value...Set string value...,具体取决于要插入的数据类型。

columns$ = "index text number" 
rows = 10 
table = Create Table with column names: "table", rows, columns$ 
for i to rows 
    # The table is already selected, but it's always a good idea 
    # to confirm the selection at the beginning of a for loop 
    selectObject: table 
    Set numeric value: i, "index", i 
    Set numeric value: i, "number", randomGauss(0, 0.1) 
    Set string value: i, "text", "this is row " + string$(i) 
endfor