dirに変数を使用する

指定ディレクトリから特定の拡張子のファイルを検索したいです.
例)dir で拡張子TIFのデータを検索するときは
FILENAME = dir('*.TIF');
ですが,ここのTIFをあらかじめ変数(EXT)にしておき,
EXT=’TIF’ などで定義できるようにしたいです.
どのように書き換えるとよいでしょうか?

 采纳的回答

こういう事ですか?
EXT='TIF';
FILENAME = dir(['*.' EXT])
FILENAME = 0×1 empty struct array with fields: name folder date bytes isdir datenum

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 ファイルの操作 的更多信息

产品

版本

R2021a

标签

Community Treasure Hunt

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

Start Hunting!