[FieldTrip] HELP: import simple data from txt file - non supported format, no header

Eugenio Abela abela.eugenio at gmail.com
Fri Nov 30 18:25:51 CET 2018

Hi Tony

Here’s a pretty quick and dirty fix - have a careful look to make sure it does what you want. You need FieldTrip installed and in the path; it works on my MATLAB2016a. Others on the list might have better ideas, or spot obvious errors.

Good luck

% Import you data
D = importdata('Pressure_3_6.txt',' ');
% Fill in FieldTrip data structure (check out ft_datatype_raw)
% I assume columns 4, 5 are EEG, 6,7 EMG.
% Channels go in rows, time in columns.
data = struct();
data.label = {'EEG-1';'EEG-2';'EMG-1';'EMG-2'};
data.fsample = 250;
data.time  = {1:length(D)};
data.trial = {D(:,4:7)’};
% Check out how it looks
cfg = [];
cfg.viemode = 'vertical';

On 29 Nov 2018, at 17:22, Hoang Truong <Hoang.Truong at colorado.edu> wrote:

Dear community,

This is Tony, from CS Department, University of Colorado Boulder. I am new to eeg analysis and fieldtrip. Currently I work on recording eeg and emg data using our own hardware with 2 eeg and 2 emg channels respectively. 
Since we use our custom hardware, the data are saved in a simple format of txt file with 7 columns (example data on Dropbox: link <https://www.dropbox.com/s/30yzafa7ukg8xhl/Pressure_3_6.txt?dl=0>): 3 first columns are data from environment sensors, the next 4 are eeg and emg data (250Hz sampling rate, 42s recording)
I would like to ask what will be a proper way for me to import this data into fieldtrip. I checked the faq about importing custom data but I do not understand how to make custom readheader, readdata and readevent function.
Any help would be appreciated (suggestions, code examples, etc).
Thank you so much.


fieldtrip mailing list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20181130/eb9236c0/attachment-0002.html>

More information about the fieldtrip mailing list