Info
この質問は閉じられています。 編集または回答するには再度開いてください。
How to load multiple .mat files into two different groups
1 回表示 (過去 30 日間)
古いコメントを表示
I'm trying to make two groups out of the processed participants, one controle group (freqct) and one patient group (freqpt). I have an active path to the folder in which files are.
When I run this code I get the following error code:
Error using load
Cannot read file I:\preprocessed\Sub10.mat.
Error in Code2_1 (line 93)
freqct = load(fullfilename);
This is the code I have written. The last couple of hours I am bashing my head against the code and have tried numerous things, none worked.
clear all
sbjs = dir('Sub*.mat');
for i = 1:8
freqct{i} = load(sbjs(i).name);
end
clear i
for i = 9:length(sbjs)
n = 1
freqpt{n} = load(sbjs(i).name);
n = n+1;
end
This is an overview of the files I want to load. In every file (Sub1.mat till Sub15.mat) there are the same files as in Sub10.mat (see below)
0 件のコメント
回答 (1 件)
KSSV
2020 年 8 月 11 日
USe this file exchange: https://www.mathworks.com/matlabcentral/fileexchange/47434-natural-order-filename-sort
First nine will be files Sub1,...Sub9 and the rest will be from Sub10.
6 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!