How to use uigetfile to open subfolder's file.

2 Ansichten (letzte 30 Tage)
han han
han han am 15 Nov. 2019
Kommentiert: han han am 15 Nov. 2019
How to use uigetfile to open the .txt in the subfolder.
Or there are other ways to use this.
[file,filepath] = uigetfile('*.txt');
WISETEST = fopen( file, 'rt');
out = textscan(WISETEST, '%s', 'Delimiter',{' '});
aa = out{1}(1:end)';
it seems to only open the .txt in the current directory.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 15 Nov. 2019
[file,filepath] = uigetfile('*.txt');
if isempty(file); return; end %user cancel
fullname = fullfile(filepath, file);
WISETEST = fopen( fullname, 'rt');
out = textscan(WISETEST, '%s', 'Delimiter',{' '});
fclose(WISETEST);
aa = out{1}(1:end)';

Weitere Antworten (0)

Kategorien

Mehr zu Large Files and Big Data finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by