[Eeglablist] eeglablist Digest, Vol 190, Issue 9

Samran samranasghar at gmail.com
Sat Aug 15 13:32:20 PDT 2020


Hi,

You can use the following code to save each epoch in a separate ascii file.
The .txt or .mat files can be saved in a similar way. Please note that
based on your or software requirements, you may need to take the transpose
of data and save that instead (i.e. channels in columns, and samples in
rows).

for j = 1:size(EEG.data, 3)

    str_trial = 'trl';
    if (j < 10)
        str_trial = [str_trial, '0', num2str(j)];
    else
        str_trial = [str_trial, num2str(j)];
    end

    trial = squeeze(EEG.data(:, :, j));

    filename = [str_trial, '.asc'];
    disp(filename);

    save(filename, 'trial', '-ascii', '-tabs');
end


Continuous data can be saved as

data = EEG.data;

save(filename, 'data', '-ascii', '-tabs');

The above code can also be used to save epoched data in .mat file.

Best,
Samran.



> ---------- Forwarded message ----------
> From: Lina Ismail <linaelsherif at knights.ucf.edu>
> To: "eeglablist at sccn.ucsd.edu" <eeglablist at sccn.ucsd.edu>
> Cc:
> Bcc:
> Date: Tue, 11 Aug 2020 19:20:16 +0000
> Subject: [Eeglablist] Eport clean data
> Dear all,
> How can I export the clean epoched EEG data saves as ."set and .fdt" into
> ".txt or .asc" for source localization
> Also, I would like to know if anyone had export the data into .mat file
>
> Best regards,
> Lina
>
>
>
>
> ---------- Forwarded message ----------
> From: Lina Ismail <linaelsherif at knights.ucf.edu>
> To: "eeglablist at sccn.ucsd.edu" <eeglablist at sccn.ucsd.edu>
> Cc:
> Bcc:
> Date: Thu, 13 Aug 2020 02:06:24 +0000
> Subject: [Eeglablist] Convert .set fille from EEGLAB
> Dear all,
> How can I convert a .set file (after finishing the pre-processing step) in
> to .txt , .mat and .asc file?
>



More information about the eeglablist mailing list