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

gui

% 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

Best Answer

In pushbutton callback,
text=fileread('C:\.....\readme.txt');
set(handles.text1,'String',text)
Related Question