フィルターのクリア

loading all files from a user specified folder into a gui

2 ビュー (過去 30 日間)
Stephen Devlin
Stephen Devlin 2018 年 1 月 19 日
コメント済み: Adam 2018 年 1 月 19 日
Hi,
Is there a way for a GUI to allow a user to select a folder of text files on their own computer and have the GUI work on all the txt files within that folder?
Best regards
Steve

採用された回答

Mahesh
Mahesh 2018 年 1 月 19 日
x = uigetfile({'*.txt'});
fid = fopen(x);

その他の回答 (1 件)

Matt J
Matt J 2018 年 1 月 19 日
編集済み: Matt J 2018 年 1 月 19 日
  1 件のコメント
Adam
Adam 2018 年 1 月 19 日
Combined with something like:
info = dir( folder );
filenames = { info.name };
[~,~,ext] = cellfun( @fileparts, filenames , 'UniformOutput', false )
txtIdx = strcmp( ext, { '.txt' } )
filenames = filenames( txtIdx )
to give you all the filenames of the desired type from the directory.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by