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

4 vues (au cours des 30 derniers jours)
% 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

Réponse acceptée

Ravi
Ravi le 11 Juil 2013
In pushbutton callback,
text=fileread('C:\.....\readme.txt');
set(handles.text1,'String',text)
  3 commentaires
Jan
Jan le 11 Juil 2013
Then please explain exactly what "open" means here. Does the first line answer your question already?

Connectez-vous pour commenter.

Plus de réponses (1)

Ilham Hardy
Ilham Hardy le 11 Juil 2013
In pushbutton callback:
open('C:\matlabcodes folder\readme.txt')
HTH, IH

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by