[Eeglablist] Issue with pop_loadset function in EEGLAB

Arnaud Delorme adelorme at ucsd.edu
Thu Jun 1 10:30:45 PDT 2023


Dear Prasannjeet,

The best strategy is to put a breakpoint in eeg_checkset or type “dbstop if error” and check the var types.
If the problem is reproducible, would you mind submitting a bug report and uploading some data at https://urldefense.com/v3/__https://github.com/sccn/eeglab/issues__;!!Mih3wA!CffrEDqnwUPlUf3EgCgC4Faz4SOG7u55ALmiWW5C-6qrl_IqS2CyWPQop2UVgKAb-Q7E8xeAun_QJnHLcKIN29lo$ 

Arno

> On May 30, 2023, at 1:26 PM, Prasannjeet Singh via eeglablist <eeglablist at sccn.ucsd.edu> wrote:
> 
> 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
> _______________________________________________
> 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




More information about the eeglablist mailing list