dirload

Dirload, is a function that lets you read all the data files in a folder and store it in a struct
178 Downloads
Updated 29 Jul 2015

View License

I was running into the problem that I needed to load too many files to a script and I wanted to have a quick way of loading them. So I created this function that the only input is the path to the folder, where it would go to the folder load all the files in the struct and come back to the folder where it started. It load them in a struct where the .filename gives you the name of the file, and .data gives you the data inside.
In the version 2.0 it looks for folder and omit them. In this version two more inputs can be done aside from the folder path. This two inputs are so if you would like to load a certain type of files and omit the rest or it can omit a certain type of file.
To load a certain file just type 'filetype' after the Folder path and then the type of the file Ex. 'txt'. And to omit a type of file type 'exfile' and the type of file the user would like to omit

Cite As

Cesar Galan (2024). dirload (https://www.mathworks.com/matlabcentral/fileexchange/51212-dirload), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2015a
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
2.1.0.0

performance
Increase performance to erase the empty data

2.0.0.0

In this new version two more inputs can be done aside from the folder path. This two inputs are so if you would like to load a certain type of files and omit the rest or it can omit a certain type of file.

1.0.0.0