Help with searching for a specific input filetype within a directory

1 回表示 (過去 30 日間)
t4741
t4741 2019 年 9 月 5 日
コメント済み: t4741 2019 年 9 月 5 日
I am trying to create a function that inputs a filetype and directory name and outputs a cell array of the images. If line 9 is written as;
imageNames = dir(filetype) and filetype = '*.jpeg' it will work.
However, the input for filetype can only be '.jpeg' (tasked constraint)
How can i fix this?

採用された回答

Stephen23
Stephen23 2019 年 9 月 5 日
F = '.jpeg'
S = dir(['*',F])

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by