You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
directory_path = 'C:\';
byteCount = DirSize(directory_path);
returns the number of bytes in the directory_path (e.g. 31,400,000)
or
byteCountString = DirSizePretty(directory_path);
returns the number of bytes in a human readable string (e.g. '31.4 MB')
Also, this was inspired by Richard Moore's DirSize, but I found that DirSize.m needed to be added to the Matlab path to function, something that I don't use in my applications. This version works without adding to the Matlab path, although that should still work
Cite As
David Freedman (2026). DirSizePretty (https://uk.mathworks.com/matlabcentral/fileexchange/72960-dirsizepretty), MATLAB Central File Exchange. Retrieved .
Acknowledgements
Inspired by: DirSize
General Information
- Version 1.0.0 (2.01 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.0.0 |
