dirに変数を使用する

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

 Risposta accettata

Atsushi Ueno
Atsushi Ueno il 20 Set 2021

0 voti

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

1 Commento

H.O
H.O il 25 Set 2021
ありがとうございます。

Accedi per commentare.

Più risposte (0)

Prodotti

Release

R2021a

Tag

Richiesto:

H.O
il 20 Set 2021

Commentato:

H.O
il 25 Set 2021

Community Treasure Hunt

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

Start Hunting!