%% Convert Text Representing Date to Date Vector

DateString = '28.03.2005';
formatIn = 'dd.mm.yyyy';
datevec(DateString,formatIn)

% datevec returns a date vector for text representing a date with the format 'dd.mm.yyyy'.
% Copyright 2012 The MathWorks, Inc.