i am trying to open a text file in my gui but its showing just the file name since i am new to matlab kindly help
조회 수: 1 (최근 30일)
이전 댓글 표시
[filename]=uigetfile({'*.txt'},'File Selector');
set(handles.edit2,'string',filename);
댓글 수: 0
답변 (1개)
Walter Roberson
2015년 5월 31일
[filename, filepath]=uigetfile({'*.txt'},'File Selector');
fullname = fullfile(filepath,filename);
%now read it.
content = fileread(fullname); %one of many ways to read files
%and display the content
set(handles.edit2, 'string', content);
참고 항목
카테고리
Help Center 및 File Exchange에서 Entering Commands에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!