date to string conversion
显示 更早的评论
when using the following code s value is prited as '00000'
Help me what the problem is.. dtntm field has date and time
aa=(DD_SlantSmoothTEC(j).dtntm);
aaa=datestr(aa);
s=strcat(aaa(1:2),aaa(4:6));
fn1=sprintf('%s%s','DD-VTEC Vs UT,HYDE-IISC PRN PAIR DAY ',s);
title(fn1);
1 个评论
Stephen23
2021-12-27
Do NOT use the outdated, deprecated, imprecise DATESTR, DATEVEC, or DATENUM.
采纳的回答
更多回答(1 个)
aa = datetime('now') % or aa = now() for double representation
s = datestr(aa,'ddmmm')
fn1 = sprintf('%s%s','DD-VTEC Vs UT,HYDE-IISC PRN PAIR DAY ',s)
类别
在 帮助中心 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!