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

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.
Then please explain exactly what "open" means here. Does the first line answer your question already?

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

카테고리

도움말 센터File Exchange에서 Environment 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