Index in position 2 exceeds array bounds (must not exceed 175).
Hello,
I am analysing EEG data using a code that was provided to me. This bit of code was working well a year ago, and I am using it now to add new datasets.I don’t understand what has changed that make it throw an error now.
The script below is used to average, plot and display the 93 EEG electrodes accross all trials for all participants. I get the following error:
Index in position 2 exceeds array bounds (must not exceed 175).
Error in butterfly_graph (line 8)
data_STD(:,:,i) = DATA{1,i}.avg(:, 1:350);
DATA is stored in a file called DataForCluster_allparticipants.mat. I don’t understand what exactly is the index in position 2 that exceeds array bounds. I apologise if the answer is very obvious.
my scripts can be found here: https://we.tl/t-0ozTcZFgex
DataForCluster_allparticipants.mat that is the file where the DATA variable is stored
The script forLucie_loadDataForCluster.mat is the script generating the DATA file
The script Butterfly_graph is the script in which I have a problem
load(‘DataForCluster_allparticipants.mat’)
cd(‘/Users/dan/Documents/LucieEEG/Analysis/Sorted’) %change this
%d(1,:) is standard
%d(2,:) is deviant
% d(3,:) is MMN
for i = 1:length(DATA)
data_STD(:,:,i) = DATA{1,i}.avg(:, 1:350);
data_DEV(:,:,i) = DATA{2,i}.avg(:, 1:350);
data_MMN(:,:,i) = DATA{3,i}.avg(:, 1:350);
endHello,
I am analysing EEG data using a code that was provided to me. This bit of code was working well a year ago, and I am using it now to add new datasets.I don’t understand what has changed that make it throw an error now.
The script below is used to average, plot and display the 93 EEG electrodes accross all trials for all participants. I get the following error:
Index in position 2 exceeds array bounds (must not exceed 175).
Error in butterfly_graph (line 8)
data_STD(:,:,i) = DATA{1,i}.avg(:, 1:350);
DATA is stored in a file called DataForCluster_allparticipants.mat. I don’t understand what exactly is the index in position 2 that exceeds array bounds. I apologise if the answer is very obvious.
my scripts can be found here: https://we.tl/t-0ozTcZFgex
DataForCluster_allparticipants.mat that is the file where the DATA variable is stored
The script forLucie_loadDataForCluster.mat is the script generating the DATA file
The script Butterfly_graph is the script in which I have a problem
load(‘DataForCluster_allparticipants.mat’)
cd(‘/Users/dan/Documents/LucieEEG/Analysis/Sorted’) %change this
%d(1,:) is standard
%d(2,:) is deviant
% d(3,:) is MMN
for i = 1:length(DATA)
data_STD(:,:,i) = DATA{1,i}.avg(:, 1:350);
data_DEV(:,:,i) = DATA{2,i}.avg(:, 1:350);
data_MMN(:,:,i) = DATA{3,i}.avg(:, 1:350);
end Hello,
I am analysing EEG data using a code that was provided to me. This bit of code was working well a year ago, and I am using it now to add new datasets.I don’t understand what has changed that make it throw an error now.
The script below is used to average, plot and display the 93 EEG electrodes accross all trials for all participants. I get the following error:
Index in position 2 exceeds array bounds (must not exceed 175).
Error in butterfly_graph (line 8)
data_STD(:,:,i) = DATA{1,i}.avg(:, 1:350);
DATA is stored in a file called DataForCluster_allparticipants.mat. I don’t understand what exactly is the index in position 2 that exceeds array bounds. I apologise if the answer is very obvious.
my scripts can be found here: https://we.tl/t-0ozTcZFgex
DataForCluster_allparticipants.mat that is the file where the DATA variable is stored
The script forLucie_loadDataForCluster.mat is the script generating the DATA file
The script Butterfly_graph is the script in which I have a problem
load(‘DataForCluster_allparticipants.mat’)
cd(‘/Users/dan/Documents/LucieEEG/Analysis/Sorted’) %change this
%d(1,:) is standard
%d(2,:) is deviant
% d(3,:) is MMN
for i = 1:length(DATA)
data_STD(:,:,i) = DATA{1,i}.avg(:, 1:350);
data_DEV(:,:,i) = DATA{2,i}.avg(:, 1:350);
data_MMN(:,:,i) = DATA{3,i}.avg(:, 1:350);
end psychology, eeg, indexing MATLAB Answers — New Questions