Hi, I'm trying to write a script that will create a new column, then create 30-second-long cells within that column. It needs to take the onset time from my ID column, make that the onset for the first column, then add new cells continuously until the offset of the ID column.
I'm pretty sure the script is going to have to loop back on itself iteratively until it reaches the offset time of the ID column.
I'm not sue how to do it, but the logic we've worked out so far is like this:
begin parentrating = createColumn("ParentRating","Rating")
id = getColumn("ID") timeoffset = (60*1000) timeonset = 1 time = id.cells.onset
#LOOP here is where you'd make the loop start #keep doing that as long as offset of parentrating cell < offset of id
cell = parentrating.make_new_cell() cell.change_code("onset", time) cell.change_code("offset", time + timeoffset)
time = cell.offset+timeonset
#LOOP AGAIN if time < id offset #LOOP END if time >= id offset
asked 30 Aug '16, 18:38
You almost have it. Here's one way to do the loop:
answered 30 Aug '16, 19:09
Shohan Hasan ♦♦