[FieldTrip] Opening preprocessed .mat files for further analysis

Constantino Méndez Bértolo constantino.mendezbertolo at ctb.upm.es
Tue Oct 21 00:20:21 CEST 2014


Dear Arti,

I suppose you already solved your problem. Just in case.

What the matlab error is telling you is: "you are giving me something (a
structure) while I was expecting a string" (you will get familiar with that
error. well or hopefully not). So in a nutshell you need to give
ft_read_header a string, probably the name of the file you have your data
exported to (extension included). A common error is calling ft_read_header
like ft_read_header(cfg) because ft_databrowser or ft_preprocessing can
open external files if you feed them with cfg.dataset - who is a string. In
your case, this is happening because you are trying to read the header of a
matlab variable - a structure of eeg data imported in fieldtrip format. So
if what I say makes sense you will see this is not a fieldtrip problem
indeed. So call something like ft_read_header('mydata.edf'). Last advice
highlight ft_read_header and press F1.

Ánimo and good luck with your data explorations



2014-10-15 3:39 GMT+02:00 Arti Abhishek <mailtome.2113 at gmail.com>:

> Apologies for the previous email. I hit send before finished typing
>
> I am stumbled upon a very basic problem ( I am a beginner MATLAB user). I
> have EEG data preprocessed and saved as .mat files. Now I want to further
> process the data. I used the following script
>
> Subjects= {'s01', 's02', 's03', 's04', 's05', 's06', 's07', 's08', 's09',
> 's10', 's11', 's12'...
>
> 's13', 's14', 's15', 's16', 's17', 's18', 's19', 's21', 's23'};
>
> Triggers = [101 111 121];
>
> Conditions = {'4Ch', '8Ch', '16Ch'};
>
> for i=1:length(Subjects)
>
> for j=1:length (Conditions)
>
> cfg =[];
>
> FileName = strcat(Subjects{i},'_', Conditions{j}, '.mat');
>
> DataFIC = load (FileName);
>
> hdr = ft_read_header (DataFIC);
>
> dat = ft_read_data(DataFIC, 'header', 'hdr');
>
> cfg.method = 'summary';
>
> cfg.channels = 'all';
>
> data_clean = ft_rejectvisual(cfg, dat);
>
> save (strcat(Subjects{i},'_', Conditions{j}) , 'data_clean')
>
> end;
>
> end;
>
> This is returning the following error
>
> Undefined function 'eq' for input arguments of type 'struct'.
>
> Error in filetype_check_uri (line 62)
> sep = find(filename==':');
>
> Error in fetch_url (line 33)
> if filetype_check_uri(filename, 'sftp')
>
> Error in ft_read_header (line 105)
> filename = fetch_url(filename);
>
> Any help would be much appreciated.
>
> Regards,
>
> Arti
>
> On Wed, Oct 15, 2014 at 12:36 PM, Arti Abhishek <mailtome.2113 at gmail.com>
> wrote:
>
>> Dear list,
>>
>> I am stumbled upon a very basic problem ( I am a beginner MATLAB user). I
>> have EEG data preprocessed and saved as .mat files. Now I want to further
>> process the data. I used the following script
>>
>> Subjects= {'s01', 's02', 's03', 's04', 's05', 's06', 's07', 's08', 's09',
>> 's10', 's11', 's12'...
>>
>> 's13', 's14', 's15', 's16', 's17', 's18', 's19', 's21', 's23'};
>>
>> Triggers = [101 111 121];
>>
>> Conditions = {'4Ch', '8Ch', '16Ch'};
>>
>> for i=1:length(Subjects)
>>
>> for j=1:length (Conditions)
>>
>>
>>
>>  cfg =[];
>>
>>
>> FileName = strcat(Subjects{i},'_', Conditions{j}, '.mat');
>>
>>
>>
>>  DataFIC = load (FileName);
>>
>>  hdr = ft_read_header (DataFIC);
>>
>>
>> dat = ft_read_data(DataFIC, 'header', 'hdr');
>>
>>  cfg.method = 'summary';
>>
>>  cfg.channels = 'all';
>>
>>
>>
>>  data_clean = ft_rejectvisual(cfg, dat);
>>
>>
>> save (strcat(Subjects{i},'_', Conditions{j}) , 'data_clean')
>>
>>  end;
>>
>> end;
>>
>>
>>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>



-- 
Constantino Méndez-Bértolo
Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB)

Parque Científico y Tecnológico de la UPM, Campus de Montegancedo

28223 Pozuelo de Alarcón, Madrid, SPAIN
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20141021/f6c78668/attachment-0002.html>


More information about the fieldtrip mailing list