필터 지우기
필터 지우기

How to select files from three different folders?

조회 수: 3 (최근 30일)
Edoardo Della Santa
Edoardo Della Santa 2018년 2월 4일
답변: Wilson A N 2018년 3월 12일
Hi everyone i'm looking for a function that allows me to select from three different folders files with extension .nii thanks in advance for the help

답변 (1개)

Wilson A N
Wilson A N 2018년 3월 12일
If you already know the path of the folders where the files with .nii resides then you can just use the following commands.
Please note that I have used the following script for finding .c files but it applies equally to .nii file extensions as well
% Assuming the folder paths as p1, p2 and p3
>> foldPath = {'p1','p2','p3'};
% Storing the .c files from each folder
>> k1 = dir(fullfile(foldPath{1},'*c'))
>> k2 = dir(fullfile(foldPath{2},'*c'))
>> k3 = dir(fullfile(foldPath{3},'*c'))
The obtained k1,k2,k3 variables are essentially structures which contain all the .c files residing in their respective folders.

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by