Matlab - Load NEDF and EASY Files using the NE EEGLAB Plugin

Modified on Wed, 12 Aug at 3:09 PM

Description

This article covers how to correctly load .nedf and .easy recordings using the Neuroelectrics EEGLAB plugin: installing the plugin, choosing the right loading function, and the channel-selection syntax that most often trips people up.


Materials / Devices / Software

  • MATLAB

  • EEGLAB

  • NE EEGLAB Plugin (EEGLab-Plugin-master)

  • .nedf or .easy recording file




Pre-requisites

  • EEGLAB installed

  • NE EEGLAB Plugin (EEGLab-Plugin-master) downloaded




Step-by-step guide


1. Install the plugin

Place the plugin folder inside EEGLAB's plugins directory.

<your_eeglab_folder>/plugins/EEGLab-Plugin-master/

  • The xml4mat folder must stay inside EEGLab-Plugin-master, not in the main EEGLAB directory.

  • NEDF files will fail to load if xml4mat is moved out of that folder.


2. Load a NEDF file

Use pop_nedf.m to load the recording.

pop_nedf('recording.nedf', 1, 0, '32');

  • Argument 1 — file: path to the .nedf file.

  • Argument 2 — acc: 0 or 1, whether to load accelerometer channel data.

  • Argument 3 — locs: 0 or 1, whether to load channel location data.

  • Argument 4 — channels_selected: channel indices as a quoted string, e.g. '32' or '1,2,5'; an empty string '' loads all channels.


3. Load an EASY file

Use pop_easy.m to load the recording.

EEG = pop_easy('recording.easy', 0, 0, '32');

  • Arguments follow the same order as pop_nedf: file, acc, locs, channels_selected.

  • channels_selected must be a quoted string here too, e.g. '32' or '1,2,5'; an empty string '' loads all channels.


4. Confirm the load succeeded

Check that the function returned without error and that data is now available.

  • An EEG struct (or equivalent data variable) should appear in your MATLAB workspace or the EEGLAB GUI.

  • Data is recorded in nV; the plugin converts it to µV automatically on load.

  • .easy files are plain-text but are fully decoded — they do not carry lower amplitude precision than .nedf.




Common Problems

Load fails with a channel-selection / str2num-related error

  • The channel-selection argument (4th parameter to pop_nedf or pop_easy) must be passed as a quoted string, even for a single channel — it's parsed with str2num, which requires string input.

Correct:   '32'

Incorrect: 32

"Undefined function 'eeg_checkset' for input arguments of type 'struct'"

  • EEGLAB is not installed, or not initialized in the current MATLAB session, since pop_easy.m and pop_nedf.m both depend on core EEGLAB functions like eeg_checkset.m. Run this once per MATLAB session before calling pop_easy or pop_nedf:

eeglab;

close;   % optional, closes the GUI window

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article