필터 지우기
필터 지우기

How to read all mat files from a folder in matlab?

조회 수: 193 (최근 30일)
FARHAD
FARHAD 2014년 7월 2일
댓글: Image Analyst 2017년 10월 12일
Hi, I have 1000 mat files in a folder. I want to use those mat files one by one. How do i read those files from a folder? Please help me.
  댓글 수: 2
Ashraf
Ashraf 2017년 10월 12일
편집: Walter Roberson 2017년 10월 12일
mat = dir('*.mat'); for q = 1:length(mat) load(mat(q).name); end
Image Analyst
Image Analyst 2017년 10월 12일
You simply copied Uladzimir's 3 year old answer from below. Anyway, that is not as robust as the code in the FAQ, a link to which I gave in my answer.

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

답변 (2개)

Uladzimir
Uladzimir 2014년 7월 2일
Try this: mat = dir('*.mat'); for q = 1:length(mat) cont = load(mat(q).name); end I haven't checked it yet, but I have an experience in opening csv files this way. I don't remember, may be "load" isn't correct for mat files.

Image Analyst
Image Analyst 2014년 7월 2일

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by