2014-10-30 19 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