confusion in the output of cellfun function
I want to find out the elapsed time, in the function file I wrote this
piece of code;
function elapsed = elapsedTime(d1,d2)
%Input d1 = '2010/12/04 12:00:00'
%Input d2 = '2010/12/14 13:06:36'
d1r = regexp(d1,'((/|:)?|[ ])?','split');
d2r = regexp(d2,'((/|:)?|[ ])?','split');
elapsed = cellfun(@minus,d1r,d2r,'UniformOutput',false);
end
the output is the following:
ans =
[1x4 double] [1x2 double] [1x2 double] [1x2 double] [1x2
double] [1x2 double]
This output format is no good as I cannot use it to find the elapsed time!
How can I use it to map it to the actual output, should it not give an
cell array like the following:
ans = '0000' '00' '00' '01' '06' '36'
is there any way to correct this?
No comments:
Post a Comment