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..

% 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 件のコメント

sermet
sermet 2013 年 7 月 11 日
in this code, text file is assigning text1. In my GUI there is no text1, I just want to open readme.txt file without any assignement.
Jan
Jan 2013 年 7 月 11 日
Then please explain exactly what "open" means here. Does the first line answer your question already?
sermet
sermet 2013 年 7 月 11 日
it's ok. Thanks

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

その他の回答 (1 件)

In pushbutton callback:
open('C:\matlabcodes folder\readme.txt')
HTH, IH

カテゴリ

ヘルプ センター および File ExchangeEnvironment and Settings についてさらに検索

タグ

質問済み:

2013 年 7 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by