Help with searching for a specific input filetype within a directory

1 vue (au cours des 30 derniers jours)
t4741
t4741 le 5 Sep 2019
Commenté : t4741 le 5 Sep 2019
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?

Réponse acceptée

Stephen23
Stephen23 le 5 Sep 2019
F = '.jpeg'
S = dir(['*',F])

Plus de réponses (0)

Catégories

En savoir plus sur File Operations dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by