In GUI, I have a push button. I want that when this push button is pressed a text file which created before opens automatically without choosing a file..

6 ビュー (過去 30 日間)
% I have a textfile which name is readme.txt Its directory: C//matlabcodes folder
%In GUI, I also have a push button. When I press this push button, I want to open "readme.txt" automatically.
thanks in advance

採用された回答

Ravi
Ravi 2013 年 7 月 11 日
In pushbutton callback,
text=fileread('C:\.....\readme.txt');
set(handles.text1,'String',text)
  3 件のコメント
Jan
Jan 2013 年 7 月 11 日
Then please explain exactly what "open" means here. Does the first line answer your question already?

サインインしてコメントする。

その他の回答 (1 件)

Ilham Hardy
Ilham Hardy 2013 年 7 月 11 日
In pushbutton callback:
open('C:\matlabcodes folder\readme.txt')
HTH, IH

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by