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 CenterFile Exchange에서 Large 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