I have a medical folder with 2 kinds of data Prostatex0000_* and Prostatex0001_*
How can i split the original folder into 2 subfolders?

3 件のコメント

Rik
Rik 2019 年 1 月 17 日
What have you tried so far? It seems this problem is not too hard to split up into parts. Which part is giving you trouble?
DIMITRIOS THEODOROPOULOS
DIMITRIOS THEODOROPOULOS 2019 年 1 月 17 日
I haven't tried anything.I just dont know how to do it...
Perhaps i must give this image to understand better
ice_screenshot_20190117-174440.png
Rik
Rik 2019 年 1 月 17 日
OK, so how can you get a list of files inside a folder? There is 1 function that does that.
And once you have that list, what method can you use to process each file individually?
How can you move a file? How can you create a folder?
How can you detect if a file starts with Prostatex0001 or Prostatex0000?
Start with these questions. This should enable you to find the solution on your own. The most important thing you learn as a programmer is splitting up your big problem into solvable parts.

サインインしてコメントする。

 採用された回答

Stephen23
Stephen23 2019 年 1 月 17 日
編集済み: Stephen23 2019 年 1 月 17 日

0 投票

In two lines:
movefile('Prostatex0000_*.nii','subdir0')
movefile('Prostatex0001_*.nii','subdir1')

1 件のコメント

DIMITRIOS THEODOROPOULOS
DIMITRIOS THEODOROPOULOS 2019 年 1 月 18 日
Thanks it works perfectly!!!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Files and Folders についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by