dirに変数を使用する

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

Risposta accettata

Atsushi Ueno
Atsushi Ueno il 20 Set 2021
こういう事ですか?
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)

Tag

Prodotti


Release

R2021a

Community Treasure Hunt

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

Start Hunting!