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

 Réponse acceptée

Atsushi Ueno
Atsushi Ueno le 20 Sep 2021

0 votes

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

1 commentaire

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

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Version

R2021a

Tags

Community Treasure Hunt

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

Start Hunting!