%s4e4.m
% Manipulate the date

a= date;             % date is a string
day=a(1:2);
month=a(4:6);
year= a(8:11);
disp(['Today''s date is ' month '/' num2str(day) '/ 2013']);
                           % datestr(now) is a string
a=datevec(datestr(now));   % convert date string into an array of doubles
year=a(1);
month=a(2);
day=a(3);
hour=a(4);
min=a(5);
sec=a(6);  % to print all those doubles as strings you need num2str
disp([ num2str(year) '/' num2str(month) '/' num2str(day) '. Time is ' num2str(hour) ':' num2str(min) ':' num2str(sec) ]);
