I have a text file (.txt) that I want insert all containing of it to Matlab GUI and show it in a text box. Sometimes this text box updates when I GUI open it so there isn’t a specified text in it. (It is like a help note for my GUI that has text, numbers etc.) . I want insert whole containing of this text file automatically to my text box in Matlab GUI. What should I do?
Thanks.
Assuming the name of the text file as
file1.txtandedit1as the handles to the text-box, which iseditboxin the context ofMATLAB GUIDE, try inserting the following code inside theOpeningFcncallback or with some GUI component callback -If the text file is not present in the current directory, provide absolute path to it instead of
'file1.txt'.