Azzera filtri
Azzera filtri

loading all files from a user specified folder into a gui

2 visualizzazioni (ultimi 30 giorni)
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

Risposta accettata

Mahesh
Mahesh il 19 Gen 2018
x = uigetfile({'*.txt'});
fid = fopen(x);

Più risposte (1)

Matt J
Matt J il 19 Gen 2018
Modificato: Matt J il 19 Gen 2018
  1 Commento
Adam
Adam il 19 Gen 2018
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.

Accedi per commentare.

Categorie

Scopri di più su Environment and Settings in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by