File Ordering Patch Utility for MATLAB

The utility patches the reordering considering the length of the filename during the sorting.
630 Downloads
Updated 18 Oct 2010

View License

main executing reference usage: usage_DisplaySelectedAllImagesOfaFileTypeFromDirectory.m

Matlab file listing list the selected files in such order, which may cause some problems for certain bulk processing for benchmark applications.

imageFiles =

chp_mri_squareSized_0.jpg
chp_mri_squareSized_1.jpg
chp_mri_squareSized_10.jpg
chp_mri_squareSized_11.jpg
chp_mri_squareSized_12.jpg
chp_mri_squareSized_13.jpg
chp_mri_squareSized_14.jpg
chp_mri_squareSized_15.jpg
chp_mri_squareSized_16.jpg
chp_mri_squareSized_17.jpg
chp_mri_squareSized_18.jpg
chp_mri_squareSized_19.jpg
chp_mri_squareSized_2.jpg
chp_mri_squareSized_20.jpg
chp_mri_squareSized_21.jpg
chp_mri_squareSized_22.jpg
chp_mri_squareSized_23.jpg
chp_mri_squareSized_24.jpg
chp_mri_squareSized_25.jpg
chp_mri_squareSized_26.jpg
chp_mri_squareSized_27.jpg
chp_mri_squareSized_28.jpg
chp_mri_squareSized_29.jpg
chp_mri_squareSized_3.jpg
chp_mri_squareSized_4.jpg
chp_mri_squareSized_5.jpg
chp_mri_squareSized_6.jpg
chp_mri_squareSized_7.jpg
chp_mri_squareSized_8.jpg
chp_mri_squareSized_9.jpg

The utility patches the reordering in such manner that the files may be picked up in the following order.

imageFiles =

'chp_mri_squareSized_0.jpg'
'chp_mri_squareSized_1.jpg'
'chp_mri_squareSized_2.jpg'
'chp_mri_squareSized_3.jpg'
'chp_mri_squareSized_4.jpg'
'chp_mri_squareSized_5.jpg'
'chp_mri_squareSized_6.jpg'
'chp_mri_squareSized_7.jpg'
'chp_mri_squareSized_8.jpg'
'chp_mri_squareSized_9.jpg'
'chp_mri_squareSized_10.jpg'
'chp_mri_squareSized_11.jpg'
'chp_mri_squareSized_12.jpg'
'chp_mri_squareSized_13.jpg'
'chp_mri_squareSized_14.jpg'
'chp_mri_squareSized_15.jpg'
'chp_mri_squareSized_16.jpg'
'chp_mri_squareSized_17.jpg'
'chp_mri_squareSized_18.jpg'
'chp_mri_squareSized_19.jpg'
'chp_mri_squareSized_20.jpg'
'chp_mri_squareSized_21.jpg'
'chp_mri_squareSized_22.jpg'
'chp_mri_squareSized_23.jpg'
'chp_mri_squareSized_24.jpg'
'chp_mri_squareSized_25.jpg'
'chp_mri_squareSized_26.jpg'
'chp_mri_squareSized_27.jpg'
'chp_mri_squareSized_28.jpg'
'chp_mri_squareSized_29.jpg'

If the utility have more optimal approach, please do not hesitate to suggest and send feedback to author.
Email: promethevx@yahoo.com.

Thank you.

Regards,
Michael Chan JT

Cite As

Michael Chan (2024). File Ordering Patch Utility for MATLAB (https://www.mathworks.com/matlabcentral/fileexchange/29033-file-ordering-patch-utility-for-matlab), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on File Operations in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.2.0.0

>> Suggestion from Donn Shull
listFilesInDirectory.m:
Emend to avoid loops and may be quicker for a large number of files.

1.0.0.0