[Eeglablist] Issue with pop_loadset function in EEGLAB

Prasannjeet Singh 8prasannjeet at gmail.com
Tue May 30 16:26:09 PDT 2023


Hello,

I am encountering an issue when trying to load a .set file using the
pop_loadset function in EEGLAB. The exact error message I’m seeing is:

Error using .*
Integers can only be combined with integers of the same class, or
scalar doubles.

Error in linspace (line 46)
        y = d1 + (0:n1).*(d2 - d1)./n1;

Error in eeg_checkset (line 1207)
        EEG.times = linspace(EEG.xmin*1000, EEG.xmax*1000, EEG.pnts);

Error in pop_loadset (line 244)
    EEG = eeg_checkset(EEG);

The code I’m using to load the .set file and call the pop_loadset function
is:

eeglab;
EEG = pop_loadset('filename', 'eeg_data.set', 'filepath',
'/Users/User/Documents/My_Documents/Thesis/MatlabProject');

Upon investigating the issue, I found that the values of EEG.xmin, EEG.xmax,
and EEG.pnts are all doubles. Here are the exact values:

   - EEG.xmin: 362.7000
   - EEG.xmax: 430.2960
   - EEG.pnts: 16900

The difference between EEG.xmin and EEG.xmax is 67.5960, which seems
reasonable.

I also checked the operands of the .* operation in the linspace function,
and they seem to be correct. The operands are calculated as follows:

d1 = EEG.xmin*1000;
d2 = EEG.xmax*1000;
n1 = 0:(EEG.pnts - 1);

The sizes and classes of the operands are as follows:

   - d1: size 1x1, class double
   - d2: size 1x1, class double
   - n1: size 1x16900, class double

Interestingly, when I run the linspace command manually with the same
parameters, it runs without any errors:

times = linspace(EEG.xmin*1000, EEG.xmax*1000, EEG.pnts);

This suggests that the issue is not with the linspace function itself or
with the values of EEG.xmin, EEG.xmax, and EEG.pnts.

Given this, I’m not sure why the error is occurring. I would greatly
appreciate any insights or advice you can provide.

Thank you for your time and assistance.

Best,
//Prasannjeet



More information about the eeglablist mailing list