필터 지우기
필터 지우기

how to load all mat files in the filenumber wise sequentially ?

조회 수: 5 (최근 30일)
megha
megha 2023년 10월 23일
편집: Stephen23 2023년 10월 23일
The mat file names on my local drive ends with the increasing number (0-16) range as shown in pictute below (InFolder.png), while on MATLAB, it gets loaded in the other sequence (0,1,10,11-15,2,3-9) (As shown in figure (InMATLAB.png)). Is it possible to load all mat files in order from (0-16)?
The file has been conventionally loaded using :
"d = dir('*.mat');"

채택된 답변

Stephen23
Stephen23 2023년 10월 23일
편집: Stephen23 2023년 10월 23일
Follow this link and click the big DOWNLOAD button in the top right corner:
Unzip it onto your MATLAB search path or current directory. Then use it like this:
S = dir('*.mat');
S = nartsortfiles(S);
..etc
Another solution is to use sufficient leading zeros so that the OS/SORT returns the filenames in the required order.

추가 답변 (0개)

카테고리

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