Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using std_dipplot with group options #819

Open
amyhdt opened this issue Oct 24, 2024 · 1 comment
Open

Error using std_dipplot with group options #819

amyhdt opened this issue Oct 24, 2024 · 1 comment

Comments

@amyhdt
Copy link

amyhdt commented Oct 24, 2024

Description

I'm not able to plot cluster dipoles with the groups option when running
STUDY = std_dipplot(STUDY,ALLEEG,'clusters',5, 'design', 4, 'groups', 'on');
This runs without the groups option.

First I was getting the error:

Index in position 2 exceeds array bounds. Index must not exceed 89.

Error in std_dipplot>dipgroups (line 761)
        subj_group{n,1} = ALLEEG(1,subjectnum(n)).group;

Error in std_dipplot (line 227)
               [cluster_dip_models, options] = dipgroups(ALLEEG, STUDY, cls, comp_to_disp, cluster_dip_models, options);

I think this is because my subjects were not named with consecutive numbers. So I altered the code around line 760 to be:

for n = 1:length(comp_to_disp)
        subjectID = comp_to_disp{n}(1:3); % Extract the subject ID (e.g., '001')
        
        % Find the corresponding subject in STUDY.datasetinfo or ALLEEG
        for i = 1:length(STUDY.datasetinfo)
            if strcmp(subjectID, STUDY.datasetinfo(i).subject) % Match the subject ID
                subjectnum(n,1) = i; % Store the index of the matched subject
                break;
            end
        end
    end

This meant that I had no error but no Figure window appeared (nothing happened).

Versions

EEGLAB 2024.1
MATLAB R2023b

@arnodelorme
Copy link
Collaborator

We would need you to share your study to reproduce the problem. Send us a link at [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants