MATLAB: How to align date formats

date conversionMATLAB

Hi, I have some dates I need converted to the same format. I've boiled it down to the following possible formats but now I'm stuck:
01/01/2016
1/01/2016
01/1/2016
1/1/2016
I need them all to be: 01/01/2016
I've tried a few things but nothing works without messing up something else at this point.

Best Answer

dates = {'01/01/2016', '1/01/2016', '01/1/2016', '1/1/2016'};
datestr(datenum(dates), 'dd/mm/yyyy')