loading all files from a user specified folder into a gui

2 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by