大量のファイルをインプットするコードを簡潔に書くことは可能でしょうか?
Show older comments
nrun = 1; % enter the number of runs here
jobfile = {'C:\0spm Caltech\normalization_job.m'};
jobs = repmat(jobfile, 1, nrun);
inputs = cell(2, nrun);
for crun = 1:nrun
inputs{1, crun} ={'C:\0spm Caltech\data\0051456\meanrest.nii,1'};
inputs{2, crun} = {'C:\0spm Caltech\data\0051456\rrest.nii,1'
'C:\0spm Caltech\data\0051456\rrest.nii,2'
'C:\0spm Caltech\data\0051456\rrest.nii,3'};
end
spm('defaults', 'FMRI');
spm_jobman('run', jobs, inputs{:});
ファイルをインプットするために
上記のコードでは3個のファイルを読みこんでいますが、
150個のファイルを読みこむ方法を教えていただきたいです。
'C:\0spm Caltech\data\0051456\rrest.nii,150'までのファイルを読みこむ必要があります。
よろしくお願いします。
Accepted Answer
More Answers (1)
YASUNORI HAMAGUCHI
on 11 Dec 2019
0 votes
2 Comments
michio
on 11 Dec 2019
コードに気になる点は特に見当たらないですが、、エラーメッセージなどあるともしかしたら・・。spm 特有の何かに起因しているのであれば、私には経験が無いので他の方のコメントを待ちましょう。
YASUNORI HAMAGUCHI
on 11 Dec 2019
Categories
Find more on Neuroimaging in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!