フィルターのクリア

Store directory listing into loopable structure

2 ビュー (過去 30 日間)
Deepayan Bhadra
Deepayan Bhadra 2022 年 1 月 27 日
編集済み: Stephen23 2022 年 1 月 27 日
Hello,
I am trying to collect the output of dir below into a folder/dataset/structure that I can loop through.
cd 'C:\Users\dbhadra\Desktop\MSD\Sensor Mixing\Pr14 Ryan Data\TC2\RT\Closed_Loop'
dir **/*RT06*.dat
The command line looks like
Files Found in: 211204-022539
2021-12-04T022539+0100_RT06_000_TC1.dat
Files Found in: 211204-022844
2021-12-04T022844+0100_RT06_000_TC1.dat
Files Found in: 211204-023148
2021-12-04T023148+0100_RT06_000_TC1.dat
How do I collect these files into one structure that I can loop through?

採用された回答

Stephen23
Stephen23 2022 年 1 月 27 日
編集済み: Stephen23 2022 年 1 月 27 日
The MATLAB approach:
P = 'C:\Users\dbhadra\Desktop\MSD\Sensor Mixing\Pr14 Ryan Data\TC2\RT\Closed_Loop';
S = dir(fullfile(P,'**','*RT06*.dat'))
S will be a structure of filenames and other file information.
In general you should avoid command sytnax like you used, and prefer using function syntax like I showed:

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

タグ

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by