I'm working with EEGlab (applying GND t0 my data set) and I've got the following error:

10 visualizzazioni (ultimi 30 giorni)
>> GND=sets2GND('gui','bsln',[-200 0],'exclude_chans',{'VEOGmas','VEOG','HEOGmas','HEOG','M1','M2'});
Error using sets2GND
The value of 'bsln' is invalid. Operands to the logical AND (&&) and OR (||) operators must be
convertible to logical scalar values. Use the ANY or ALL functions to reduce operands to logical
scalar values.

Risposte (2)

maria rebecca
maria rebecca il 6 Nov 2024 alle 11:38
i had the same problem. th error occurs in the sets2GND function, where the code attempts to validate the bsln parameter:
p.addParamValue('bsln',[],@(x) isnan(x) || (isnumeric(x) && length(x)==2));
isnan(x) returns a logical array, but if x is an array with two elements (as in your case), isnan(x) would return a logical array of length 2. this cause the error, since logical operators cannot work with arrays.
so, i solved the error by replacing the original line of code with:
p.addParamValue('bsln', [], @(x) any(isnan(x)) || (isnumeric(x) && length(x) == 2));
I should specify that i'm using eeglab2022.1, and matlab R2022b.
Hope this helps!

Umar
Umar il 20 Ott 2024

Hi @Sabela Fondevila Estévez,

After reviewing the documentation provided at the link below,

http://kutaslab.ucsd.edu/matlabmk_fn_docs/matlabmk/sets2GND.html

The bsln parameter should be a vector indicating the start and end times of the baseline window in milliseconds. For instance, [-200 0] is a valid input if you wish to use a baseline from -200 ms to 0 ms relative to stimulus onset. Ensure that this parameter is correctly formatted as a two-element vector. For example:

     bsln = [-200 0]; % Correct format

Also, make sure that bsln is not mistakenly set as a non-numeric value or a single number (e.g., -200 instead of [-200 0]).

The error message suggests that somewhere within the function, logical operations expect scalar values. If other inputs are incorrectly set, they may indirectly affect how bsln is interpreted.

Double-check your input syntax. Here is how you might structure your function call:

     GND = sets2GND('gui', 'bsln', [-200 0], 'exclude_chans', {'VEOGmas', 
     'VEOG', 'HEOGmas', 'HEOG', 'M1', 'M2'});

If you have modified any part of your EEGLAB dataset or settings, revert those changes and test again. Ensure that your EEGLAB installation is up to date, as bugs in earlier versions may cause unexpected behavior. If you do not wish to apply any baseline correction, you can set bsln to NaN. This would look like:

     GND = sets2GND('gui', 'bsln', NaN, 'exclude_chans', {'VEOGmas', 'VEOG', 
    'HEOGmas', 'HEOG', 'M1', 'M2'});

If problems persist, consult the EEGLAB forums or documentation for similar issues encountered by other users.

Hope this helps.

Categorie

Scopri di più su Introduction to Installation and Licensing in Help Center e File Exchange

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by