全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 MATLAB等数学软件专版
7496 1
2013-05-21
比如说进行一个实验,一个list里面有很多trial,但是只要经过3分钟就结束实验,这个怎么做啊
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2015-2-1 20:01:22
一 设随机间隔:
inline中:
setTextDisplay4.duration= random (2000,6000)
解释: TextDisplay4为控件类型
       (2000,6000)随机刺激间隔
2000ms4000ms 6000ms随机间隔
TextDisplay1.duration=2000*random(1,3)
解释同上
二 打开端口命令
inline1:
打开端口命令:
SoundOut1.OnsetSignalEnabled= True
请打开控件SoundOut1的端口
SoundOut1.OnsetSignalPort= &H378
打开SoundOut1端口为H378(固定的)
SoundOut1.OffsetSignalEnabled= True
关闭控件SoundOut1的端口
SoundOut1.OffsetSignalPort= &H378
关闭控件SoundOut1的端口为H378


inline2:
SoundOut1.OnsetSignalData= c.GetAttrib("Condition")
向ERPs发送控件SoundOut1的刺激信号(Mark),这个刺激信号从List中的condition(code)获取

三 选择语句使用

inline3:

1.假如反应为“1”或“3”,则标记为“1”或“3”;不反应则标记为“2”

ifAnswer.resp=”1” or Answer.resp=”3” then

WritePort&H378,c.GetAttrib(“Answer.resp”)

elseWritePort &H378,2

endif

“Answer”是刺激的名称

此句应放在“Answer”后面

2.       当反应的按键是字母(如j、f)时:

“按f键读为1,按j键读为2,无需按键时读为3。”标在后面


ifTarget.resp = "f" then

writePort&H378,1

elseifTarget.resp = "j" then

writePort&H378,2

elsewritePort &H378,3

endif
3.if语句还可以写成ifthen
IfTarget.GetAttrib(“code”)=“5” and back.GetAttrib(“code2”)>0  and resp = "j" and Target. c.GetAttrib(“code”)=“5”then writePort &H378,3
如果Target获得的刺激类型5,同时反馈刺激为J 那么向端口输出,mark为3
当然还可以继续增加And多个条件。

四,被试休息语句
inline4:
dima as Integer

a=c.getattrib("List1.sample")
ifa mod 9=0 then
msgbox("Itis time to rest,you havefinished"&int(a/9)&"/10"&",Press SPACE tocontinute")
Endif
说明:
每9个trial休息一次,休息时已经完成了全部trial的10分之(a/9),"10"可根据具体实验修改

dimss as string
ss=inputbox("请输入文字","数据输入")
让被试输入中文,然后判断他答案的对错吗?
那样的话可以插入一个inline,复制以下语句
dimans as string
InputAns:
       ans = AskBox("你的问题","默认的答案,没有可以省略")
       if ans = "正确答案"then
           '正确的情况
       else
           '错误的情况
      'goto InputAns    '如果需要被试输错了重新输入的话去掉本行开头的单引号
    end if
五 行为数据提取,很复杂没有看懂感兴趣的可以自己学习
write the response of the stimulus to thedat file inorder to merge data

Dim x,y,z,a,g,j As string
x=List1.Order.Count
y=TextDisplay1.RESP
a=c.GetAttrib("code")
g=c.getattrib("stim")
j=c.getattrib("resp")
IF TextDisplay1.RESP = "a" THEN
y = 1
END IF
IF TextDisplay1.RESP = "b" THEN
y = 2
END IF

Dim y1,z1,a1,x2,x3,x4 As integer
x1=x1+1
y1=val(y)
z1=val(z)
a1=val(a)
x2=x1+1
x3=val(g)
x4=val(j)

if TextDisplay1.RESP<>""then
Write#1,x1,y1,a1,TextDisplay1.ACC,TextDisplay1.RT,g
Write #1,x2,0,y1,0,0,j
x1=x1+1
else
Write #1,x1,y1,a1,TextDisplay1.ACC,TextDisplay1.RT,g
x1=x1
end if
'Write #1,x1,0,z1,1,0
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群