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!