Is there a version of dir that takes a path?

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

Stephen23
Stephen23 2018년 3월 30일
편집: Stephen23 2018년 3월 31일
"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.
~ is supported on Mac.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 File Operations에 대해 자세히 알아보기

제품

태그

질문:

2018년 3월 30일

편집:

2018년 3월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by