datestr generating different string
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Simon Lind
am 1 Mai 2021
Kommentiert: Simon Lind
am 1 Mai 2021
I have an array with days, months and years. This is my string
[myd '/' mym '/' myy]
ans =
20/01/2014
But datestr generates this
datestr([myd '/' mym '/' myy])
ans =
06-Jul-0025
Any clue?
Thanks
0 Kommentare
Akzeptierte Antwort
Chad Greene
am 1 Mai 2021
How about
myy = 2014;
mym = 1;
myd = 20;
datestr(datenum(myy,mym,myd),'dd/mm/yyyy')
3 Kommentare
Chad Greene
am 1 Mai 2021
How's this?
datestr(datenum(string([myd '/' mym '/' myy]),'dd/mm/yyyy'))
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Operators and Elementary Operations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!