Matlab读取Eprime数据(txt文档) 您所在的位置:网站首页 eprime导出整个脚本 Matlab读取Eprime数据(txt文档)

Matlab读取Eprime数据(txt文档)

2024-06-29 19:35| 来源: 网络整理| 查看: 265

Eprime程序跑完后生成的数据是edat格式,matlab不能直接读取,如果手动merge和export我觉得不太方便,尤其当数据是陆续收集而不是一下子就收好的时候。而且如果两个edat文件的被试或者session编号一样就会覆盖,改了外面文件名也无用。

所以我选择用Matlab读取Eprime附带生成的txt文件提取想要的信息,里面内容是齐全的,只不过不像edat文件一样是表格形式比较直观。

我写了两个函数,一个适用event-related design,另一个适用block design。我的程序都会在最开始放一张空屏用来记录实验开始的时间(变量名称‘onset’)。下面的edat_event适用两种情况,一种是我们感兴趣的trial变量名称可以帮助区分不同实验条件,比如stroop任务里一致trial和不一致trial名称分别为StimCon和StimIncon;另一种情况是trial变量名称一样(e.g.‘Stim’),但是每个trial所属的Procedure或者自己定义的变量可以用来区分不同实验条件(e.g. {'Switch','Repeat'})。基本思想是找出离可区分条件的变量名称最近的trial数据。输出变量data会记录每个条件下每个trial的onset, acc和rt。

function data = edat_event(filename,ConditionList,TaskOnsetVar,vars) % Catch info of onset, acc, and rt of each trial in each condition from edat data (Eprime). % This is suitable for event-related design. % Matlab can read .txt files but not .edat %--------------------------------------usage------------------------------------------------ % filename: the txt filename for edat, e.g. 'TS-1-1.txt' % ConditionList: experimental conditions, e.g. {'Switch','Repeat'} % TaskOnsetVar: the variable indicates when the task begins, e.g. 'onset' % vars: variable names to read, e.g. {'Stim1','Stim2'} % output data is a 1*N cell, N is


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有