Using fullfile for multiple file names
이전 댓글 표시
Hi,
I am trying to select 3 files (con_001.img, con_002.img, con_003.img) and store them in a 3x1 cell named P. I have specified C={'con_001.img','con_002.img','con_003.img'}. I first did the following:
for f=1:length(C)
P = cell(f,1);
P{f,1} = spm_select('FPList', fullfile(data_path),sprintf('%s',cell2mat(C(1,f))));
end
Of course the above gave me P containing only con_003.img and not the other two images. I then tried:
P{1:f,1} = spm_select('FPList', fullfile(data_path), sprintf('%s',cell2mat(C(1,f))));
This time it didn't work at all.
Could some one please help?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Filename Construction에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!