Help with searching for a specific input filetype within a directory

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 File Operations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by