Is there a version of dir that takes a path?

1 visualización (últimos 30 días)
Brando Miranda
Brando Miranda el 30 de Mzo. de 2018
Editada: Stephen23 el 31 de Mzo. de 2018
I want to use `dir` to get some list of files. But to do this I need to cd into a directory which seems really dum. Is there not a version of dir that just takes a path? i.e. something like:
dir('~/cool/path/files_*')
this way I specify the path and only the files with that format without having to cd into places.
  2 comentarios
Stephen23
Stephen23 el 30 de Mzo. de 2018
Editada: Stephen23 el 31 de Mzo. de 2018
"But to do this I need to cd into a directory which seems really dum."
The dir documentation clearly states that it accepts "absolute or relative path names". See also:
It is possible that ~ is not supported on your OS.
Walter Roberson
Walter Roberson el 30 de Mzo. de 2018
~ is supported on Mac.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

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

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by