Created
September 23, 2020 14:27
-
-
Save roslovets/90e34d69ed7f540e98fe22d204ba4c1c to your computer and use it in GitHub Desktop.
MATLAB: convinient dir()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fs = dir2(dpath) | |
arguments | |
dpath string = pwd | |
end | |
fs = struct2table(dir(dpath), 'AsArray', true); | |
fs = convertvars(fs, 1:2, 'string'); | |
fs = fs(~ismember(fs.name, ["." ".."]), :); | |
fs.date = datetime(fs.datenum, 'ConvertFrom', 'datenum'); | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment