Prev: Adding different sized matrix
Next: real time plot
From: Vasu D on 19 Jul 2010 07:44 Hello, First thanks for 'us' reply.I tried the code to sort the images by creation date .I am giving it below. ==> indir = uigetdir(); cd(indir); allimages=dir('*.png'); [ai,ix]=sort([allimages.datenum]); len = length(ai); msgbox(num2str(len)); len1 = length(ix); msgbox(num2str(len1)); %flst={flst(ix).name}.'; % for i=1:len % aiout = ai(i); % ixout = ix(i); % x=num2str(aiout); % y=num2str(ixout); % msgbox(strcat(x,y)); % end for k = 1:length(allimages) fileno = ix(k); filename = allimages(fileno).name; data1 = imread(filename); figure,imshow(data1); end I am getting an error as below. ==> ??? Reference to non-existent field 'datenum'. Error in ==> newproblem at 5 [ai,ix]=sort([allimages.datenum]); I am using matlab of version 7.0.0.1 . Could anyone help me in this. regards, Vasu D.
From: us on 19 Jul 2010 07:54 "Vasu D" <funnybooknpen(a)gmail.com> wrote in message <i21dq4$1p8$1(a)fred.mathworks.com>... > Hello, > First thanks for 'us' reply.I tried the code to sort the images by creation date .I am giving it below. > ==> > indir = uigetdir(); > cd(indir); > allimages=dir('*.png'); > [ai,ix]=sort([allimages.datenum]); > len = length(ai); > msgbox(num2str(len)); > len1 = length(ix); > msgbox(num2str(len1)); > %flst={flst(ix).name}.'; > % for i=1:len > % aiout = ai(i); > % ixout = ix(i); > % x=num2str(aiout); > % y=num2str(ixout); > % msgbox(strcat(x,y)); > % end > for k = 1:length(allimages) > fileno = ix(k); > filename = allimages(fileno).name; > data1 = imread(filename); > figure,imshow(data1); > end > > I am getting an error as below. > > ==> > ??? Reference to non-existent field 'datenum'. > > Error in ==> newproblem at 5 > [ai,ix]=sort([allimages.datenum]); > > I am using matlab of version 7.0.0.1 . Could anyone help me in this. > > regards, > Vasu D. do NOT double post... two CSSMers have already shown a work-around in your OP... us
|
Pages: 1 Prev: Adding different sized matrix Next: real time plot |