Is there a version of dir that takes a path?

1 回表示 (過去 30 日間)
Brando Miranda
Brando Miranda 2018 年 3 月 30 日
編集済み: Stephen23 2018 年 3 月 31 日
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.
Walter Roberson
Walter Roberson 2018 年 3 月 30 日
~ is supported on Mac.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by