From: Jon on
"Atahan Tolunay" <atato326(a)hotmail.com> wrote in message <hupbs1$7k3$1(a)fred.mathworks.com>...
> I have several files named "Jack.mat, Peter.mat, Kelly.mat" in my folder. When I start up my MainGUI.m I want all those file names to be imported to my listbox. What kind of function do I need to write in the listbox1_CreateFcn to import all .mat file names in my folder into the listbox on startup?

cd('directory') moves you to the directory

names = dir('*.dat') would find every file ending in .dat and save it to a structure.

names(1).name would give you the name of the first file for instance.