Reading file paths into cell array

조회 수: 19 (최근 30일)
Paul Metcalf
Paul Metcalf 2013년 5월 13일
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

채택된 답변

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

추가 답변 (2개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 5월 13일
files=ls('yourfolder')
  댓글 수: 1
Jan
Jan 2013년 5월 13일
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.

댓글을 달려면 로그인하십시오.


Paul Metcalf
Paul Metcalf 2013년 5월 13일
Thanks guys...

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by