output a file text in a uicontrol of style 'static text'
1 view (last 30 days)
Show older comments
Hallo.
I would like to output a text file in a GUI containg a unique large static text uicontrol (This is meant to be a Help window for another GUI).
I understand that the Text that I want to display should be set as the String property, for example the following code in the CreateFcn callback
Text = 'Hallo world!'
set(hObject,'String',Text)
works fine. But how can I obtain Text from a file which contains (multiline) text? Thanks.
0 Comments
Accepted Answer
Jan
on 23 Feb 2012
fid = fopen('filename.txt');
if fid < 0, error('Cannot open file'); end
C = textscan(fid, '%s', 'Delimiter', '\n');
fclose(fid);
0 Comments
More Answers (2)
See Also
Categories
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!