Thanks in advance
Rajesh
% Data
D = dir;
% Engine
S = [D(:).datenum].'; % you may want to eliminate . and .. first.
[S,S] = sort(S);
S = {D(S).name} % Cell array of names in order by datenum.
Is this what you want?
A = dir;
[~,idx] = sort([A.datenum]);
then idx is the list from oldest to newest.
I.e.
oldest = A(idx(1))
newest = A(idx(end))
But thanks a lot for your suggestion. I really appreciate your effort to solve my querry.
Rajesh
"Matt Fig" <spam...@yahoo.com> wrote in message <i6drc2$mgf$1...@fred.mathworks.com>...
You could write your own wrapper 'dir' function that masks this behind the scenes work to make it elegant:
function out = ddir;
A = dir
... %rest of engine
end