How to use uigetfile to open subfolder's file.

1 回表示 (過去 30 日間)
han han
han han 2019 年 11 月 15 日
コメント済み: han han 2019 年 11 月 15 日
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.

採用された回答

Walter Roberson
Walter Roberson 2019 年 11 月 15 日
[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)';

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLarge Files and Big Data についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by