Hi, I import a pdf file from a folder; the pdf file name has two dates (the start date and the end date); the command datevec has to be used two obtain finally a vector which I use further. If I use just one date, it works,using two dates does not.

1 view (last 30 days)
if true
% code
end
myfolder='directory\';
f=dir(myfolder);
f={f.name};
n=find(strcmp(f,'04_12_2017 09.23 05_12_2017 09.12.pdf'));
x=f{n}
y=x(1:end-4)
ris=cellstr(y)
e=datetime(ris, 'InputFormat', 'dd_MM_yyyy HH.mm')
f=datevec(e)

Answers (0)

Categories

Find more on Dates and Time in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!