dirに変数を使用する

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

Accepted Answer

Atsushi Ueno
Atsushi Ueno on 20 Sep 2021
こういう事ですか?
EXT='TIF';
FILENAME = dir(['*.' EXT])
FILENAME = 0×1 empty struct array with fields: name folder date bytes isdir datenum
  1 Comment
H.O
H.O on 25 Sep 2021
ありがとうございます。

Sign in to comment.

More Answers (0)

Tags

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!