Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read Filenames from a directory in an Array

Status
Not open for further replies.

Kait

Automotive
Oct 25, 2004
1
Hi,

i would like to read filenames from an directory in an array so that i can loop over the array, open a file in the array, process it and save it and so on.

How can i read all filenames of an directory in an array??

Thanks
Kai
 
Replies continue below

Recommended for you

Read the contents of a directory using the dir command.
Code:
d = dir('*.dat');

Loop through the files and process them
Code:
for indx=1:lenght(d)
   process( d(indx).name ) % your processing function here
end
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor