displaying date as title of figure
Show older comments
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?
Accepted Answer
More Answers (1)
Fangjun Jiang
on 26 Oct 2017
1 vote
The output of datestr() is already a string, so you don't need to use sprintf() anymore. Use datastr() directly.
If you still need to use sprintf(), then use '%s' instead of '%.3f'.
Categories
Find more on Title 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!