[Eeglablist] Importing .cnt files result in undefined function or variable "e"

Makoto Miyakoshi mmiyakoshi at ucsd.edu
Thu Jul 23 10:18:17 PDT 2015

Dear Nicholas,

I never used loadcnt.m but I look into it anyway.
The variable e appears first in line 296 in this way

for n = 1:h.nchannels
    e(n).lab            = deblank(char(fread(fid,10,'char')'));
    e(n).reference      = fread(fid,1,'char');
    e(n).skip           = fread(fid,1,'char');
    e(n).reject         = fread(fid,1,'char');
    e(n).display        = fread(fid,1,'char');
    e(n).bad            = fread(fid,1,'char');
    e(n).n              = fread(fid,1,'ushort');
    e(n).avg_reference  = fread(fid,1,'char');
    e(n).clipadd        = fread(fid,1,'char');
    e(n).x_coord        = fread(fid,1,'float');
    e(n).y_coord        = fread(fid,1,'float');
    e(n).veog_wt        = fread(fid,1,'float');
    e(n).veog_std       = fread(fid,1,'float');
    e(n).snr            = fread(fid,1,'float');
    e(n).heog_wt        = fread(fid,1,'float');
    e(n).heog_std       = fread(fid,1,'float');
    e(n).baseline       = fread(fid,1,'short');
    e(n).filtered       = fread(fid,1,'char');
    e(n).fsp            = fread(fid,1,'char');
    e(n).aux1_wt        = fread(fid,1,'float');
    e(n).aux1_std       = fread(fid,1,'float');
    e(n).senstivity     = fread(fid,1,'float');
    e(n).gain           = fread(fid,1,'char');
    e(n).hipass         = fread(fid,1,'char');
    e(n).lopass         = fread(fid,1,'char');
    e(n).page           = fread(fid,1,'uchar');
    e(n).size           = fread(fid,1,'uchar');
    e(n).impedance      = fread(fid,1,'uchar');
    e(n).physicalchnl   = fread(fid,1,'uchar');
    e(n).rectify        = fread(fid,1,'char');
    e(n).calib          = fread(fid,1,'float');

If this 'e' is not defined, it's possible that these lines are not
processed correctly. Which means most likely your h.nchannels is wrong. In
line 146,

h.nchannels         = fread(fid,1,'ushort');

Maybe your channel info was not read properly here?

> May I ask if this is because of missing electrode location data in the
.cnt file?

I'm not sure if it's location itself, but probably the issue is in the
number of channels.


On Thu, Jul 9, 2015 at 1:34 AM, Nicholas Lin <
linweikangnicholas at yahoo.com.sg> wrote:

> Hello, I am new to EEGLAB and I encountered the following issue when I
> tried importing my Neuroscan .cnt file into EEGLAB. In GUI I left all the
> fields blank, and checked the autodetect choice for determining file type.
> %
> EEGLAB error in function loadcnt() at line 681:
> Undefined function or variable 'e'.
> %
> In the MATLAB command window, I received the following:
> %
>          Consider using DBSTOP IF NANINF when debugging.
> > In loadcnt at 355
>   In pop_loadcnt at 135
> Warning: Divide by zero. This warning will be removed in a
> future release.
>          Consider using DBSTOP IF NANINF when debugging.
> > In loadcnt at 387
>   In pop_loadcnt at 135
> Skipping event table (tag != 1,2,3 ; theoritically impossible)
> >>
> %
> May I ask if this is because of missing electrode location data in the
> .cnt file? Or is due to another reason? I am unable to share my .cnt file
> data though because I do not have permission to. Your help is greatly
> appreciated!
> Thank you!
> Nick
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to
> eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to
> eeglablist-request at sccn.ucsd.edu

Makoto Miyakoshi
Swartz Center for Computational Neuroscience
Institute for Neural Computation, University of California San Diego
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20150723/79934748/attachment.html>

More information about the eeglablist mailing list