Re: opening a txt file and displaying it in the gu
- From: Jérôme <dutmatlab@xxxxxxxx>
- Date: Fri, 15 Sep 2006 05:42:38 -0400
teeboo wrote:
open a text file (notepad) and
show its contents in the edit box in the GUI?
Hi,
try this :
fid=fopen('Matisse.txt','wt');
for n=1:50
fprintf(fid,['"Il faut regarder toute la vie avec'...
'des yeux d''enfant." Henri Matisse (%d)\n\n'],n);
end
fclose(fid);
figure
sp=.0625;
x=.25;
txt(1)=uicontrol('style','text', ...
'units','normalized',...
'position',[sp .25 x .5],...
'horizontalalignment','left');
txt(2)=uicontrol('style','edit', ...
'units','normalized',...
'position',[2*sp+x .25 x .5],...
'horizontalalignment','left',...
'max',n);
txt(3)=uicontrol('style','listbox', ...
'units','normalized',...
'position',[3*sp+2*x .25 x .5],...
'horizontalalignment','left', ...
'max',n);
str=textread('Matisse.txt','%s','delimiter','\n');
set(txt(1),'string',str)
set(txt(2),'string',str)
set(txt(3),'string',str)
Jérôme
.
- Follow-Ups:
- Re: opening a txt file and displaying it in the gu
- From: teeboo
- Re: opening a txt file and displaying it in the gu
- References:
- opening a txt file and displaying it in the gui
- From: teeboo
- opening a txt file and displaying it in the gui
- Prev by Date: opening a txt file and displaying it in the gui
- Next by Date: image segmentation (need help urgently)
- Previous by thread: opening a txt file and displaying it in the gui
- Next by thread: Re: opening a txt file and displaying it in the gu
- Index(es):