Reading file paths into cell array

19 Ansichten (letzte 30 Tage)
Paul Metcalf
Paul Metcalf am 13 Mai 2013
Hi all, Sorry for the how-to question (I don't normally ask these types of questions) but I'm a bit rushed on a job. I'll make it up by answering a few other questions. I need to read all the file names in the MATLAB path into an array, such that I can loop my program through each file without having to pass in file paths manually. Any ideas!? Thanks again, Paul

Akzeptierte Antwort

Yao Li
Yao Li am 13 Mai 2013
Try
list=dir()
all the file names under the specific folder will be listed and stored in the variable list

Weitere Antworten (2)

Azzi Abdelmalek
Azzi Abdelmalek am 13 Mai 2013
files=ls('yourfolder')
  1 Kommentar
Jan
Jan am 13 Mai 2013
LS replies a slightly modificated output of DIR as a string. Parsing it afterwards to get a list of names wastes time compared with takeing the output of DIR directly.

Melden Sie sich an, um zu kommentieren.


Paul Metcalf
Paul Metcalf am 13 Mai 2013
Thanks guys...

Kategorien

Mehr zu File Operations finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by