This is an enhancement to MATLAB's dir function, for dealing with sequentially numbered files.


Updated Mon, 23 Nov 2009 08:24:37 +0000

View License

This function is designed for dealing more easily with filenames. It is particularly useful for locating files with a numerical suffix, as might be used for data files that are sequentially numbered. In addition to the fields of dir, it also returns a path field and a number field. It also allows for executing functions whose input is a filename. Examples are open, delete, ...

Type help new_dir to find examples.

Cite As

Stephan Koehler (2023). new_dir.m (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes

Improvement for handling errors

Bug fix, and added the option to restrict search to directories or non-directories.

Thanks for the comment Jan. I fixed the varargin bug (it was just an oversight), and adopted your other suggestions.

Bugs have been fixed, and examples are much easier. to get started create a test directory by typing "new_dir -generate", and follow the examples in help new_dir.