Hi. I have 11 images in a folder and I want to read and display them. I tried few of ur codes bt the images displayed are nt sorted. plz help me
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi. I have 11 images in a folder and I want to read and display them. I tried few of ur codes bt the images displayed are nt sorted. plz help me
댓글 수: 1
Jan
2017년 4월 3일
Sorted according to which criterion? Please show the code and explain the problem explicitely.
답변 (2개)
Stephen23
2017년 4월 3일
편집: Stephen23
2021년 5월 4일
Taking a guess that the order should be alphanumeric, in which case you could download my FEX submission natsortfiles which sorts filenames alphanumerically. The submission includes lots of examples, so you should read its documentation carefully:
P = 'C:\Test';
S = dir(fullfile(P,'*.txt'));
S = natsortfiles(S);
for k = 1:numel(S)
F = fullfile(P,S(k).name)
... your code
end
댓글 수: 0
Amruta Talreja
2017년 4월 4일
댓글 수: 1
Stephen23
2017년 4월 4일
편집: Stephen23
2017년 4월 4일
Read my answer again: the very first line that I wrote states that you will need to "download my FEX submssion", and I also gave the link:
- Click on that link.
- Click on the big blue button "Download".
- Save the zip file.
- Uinzip the zip file into your current directory.
- You are now ready to use my FEX submssion natsortfiles.
I did not write that link an d tell you to download the file just for my own entertainment: it is because if you want to use my FEX submission you need to download it. So that is what I told you to do.
참고 항목
카테고리
Help Center 및 File Exchange에서 Downloads에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!