MATLAB: Displaying date as title of figure

displaying graph title figure

hi, i want to display a date as title of a figure.
caption = sprintf(' %.3f', datestr(q{:,1}(1,1)));
This q cell array contains a dateserial number. When I display it as datestr then I get random numbers but not the actual date. How can I change that?

Best Answer

caption = datestr(q{:,1}(1,1));
It is already text: you do not need to format it.