From: only on
i added a push button to gui and made it open aspecific folder .how can i display the content of this folder in listbox.
i need the function to do it.
From: ImageAnalyst on
On Mar 30, 3:54 pm, "only " <only_love_...(a)yahoo.com> wrote:
> i added a push button to gui and made it open aspecific folder .how can i display the content of this folder in listbox.
> i need the function to do it.

------------------------------------
Use listOfFilenames=dir(yourFilePatternString) to get the list of
filenames.
Then use set(handles.lsitbox1, 'string', listOfFilenames) to load up
the listbox.
From: Walter Roberson on
only wrote:
> i added a push button to gui and made it open aspecific folder .how can
> i display the content of this folder in listbox.
> i need the function to do it.

function h = ListContents(TheFolderName, LowerLeft)
%The author is not responsible for the faulty specifications for
%the functionality.

if ~exist('TheFolderName', 'var')
TheFolderName = '.';
end
if ~exist('LowerLeft', 'var')
LowerLeft = [0 0];
end

fileinfo = dir(TheFolderName);
if isempty(fileinfo)
h = 'Non-existent folder';
return
end
filenames = {fileinfo.name};
h = uicontrol('Style','list', 'Units', 'pixels', ...
'Position', [LowerLeft 0 0], String', filenames);
ext = get(h, 'Extent');
set(h, 'Position', [LowerLeft ext(3)+17 ext(4)]);

end


From: Kirill on
uigetdir

Kirill
From: only on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <58ca9271-1290-4117-ae22-f8547ca18b41(a)31g2000vbq.googlegroups.com>...
> On Mar 30, 3:54 pm, "only " <only_love_...(a)yahoo.com> wrote:
> > i added a push button to gui and made it open aspecific folder .how can i display the content of this folder in listbox.
> > i need the function to do it.
>
> ------------------------------------
> Use listOfFilenames=dir(yourFilePatternString) to get the list of
> filenames.
> Then use set(handles.lsitbox1, 'string', listOfFilenames) to load up
> the listbox.

what do u mean by FilePatternString?