Borrar filtros
Borrar filtros

Help with searching for a specific input filetype within a directory

1 visualización (últimos 30 días)
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?

Respuesta aceptada

Stephen23
Stephen23 el 5 de Sept. de 2019
F = '.jpeg'
S = dir(['*',F])

Más respuestas (0)

Categorías

Más información sobre File Operations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by