Hi @Joana, from my understanding, you have generated a “feat_Concatenate” array in which you have concatenated all the features. You want to concatenate all the rest elements (1:i-1), other than the ith element together to perform analysis on them.
To perform this task, we can use array indexing in MATLAB to save current feature and other features in different variables.
currentFeature = Es{i};
otherFeatures = Es([1:i-1, i+1:end]); % Get all elements except the i-th one
If you want to concatenate the features from 1 to i-1 and not the later ones, we can use the below notation:
otherFeatures = Es([1:i-1]);
Below is the complete MATLAB code with changes:
Es = cell(1, 30);
feat_Concatenate = cell(1, 30);
for i = 1:30
resultFileName = sprintf('Sub%i.mat', i);
load(resultFileName)
Es{i} = feat';
% Save the current feature separately
currentFeature = Es{i};
otherFeatures = Es([1:i-1, i+1:end]); % Get all elements except the i-th one
feat_Concatenate{i} = vertcat(otherFeatures{:}); % Concatenate the remaining features
% Perform your data analysis with currentFeature and feat_Concatenate{i}
end
Attaching the documentation of Array Indexing in MATLAB for reference:
I hope this helps.