How to select specific files from a list

5 ビュー (過去 30 日間)
Ricardo Duarte
Ricardo Duarte 2023 年 10 月 15 日
コメント済み: Walter Roberson 2023 年 10 月 16 日
Dear all,
I have a list of wav files like this:
DATA_063901
DATA_064201
DATA_064501
DATA_064801
DATA_065101
.
.
.
DATA_123602
DATA_123901
DATA_124201
DATA_124501
DATA_124801
DATA_125101
Which corresponds to hours, minutes and seconds.
Now I want to only compute one file per hour (or two files per hour), let's say I want to compute for example:
DATA_064501
DATA_074501
DATA_084501
DATA_094501
DATA_104501
How can I do that?
Thank you in advance

回答 (1 件)

Walter Roberson
Walter Roberson 2023 年 10 月 15 日
編集済み: Walter Roberson 2023 年 10 月 15 日
  2 件のコメント
Ricardo Duarte
Ricardo Duarte 2023 年 10 月 16 日
Unfortunatly this doesn't help.
I have a list of files as you can see in the following attachements.
Now I want to select one or two files per hour. The problem is that the number of files per hour is not the same. Let's say, I want to select one file in each hour, our one file every 30 minutes.
Thank you in advance
Walter Roberson
Walter Roberson 2023 年 10 月 16 日
What is the rule about which file to select within each hour? The example you gave asked to select several files, all of which end in 4501 which would suggest that your strategy could be along the lines of
Selected_Files = ListOfFiles(endsWith(ListOfFiles, '4501.WAV', 'ignorecase', true));
See also pattern for how to change the 4501.WAV to something that can match two different endings
If your filenames are not as regular as in your example, then you are going to need to describe the algorithm for figuring out which filenames to use.

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

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by