How to change [jul15,jul16,jul17] to [7.15,7.16,7.17]?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
xander fong
am 21 Jul. 2015
Beantwortet: Guillaume
am 21 Jul. 2015
Hello, so I have a vertical array of imported excel data that are in the format "Jul15, Jul16, Jul17, etc..." I would like to know how to change every element to its respective date in number format ("7.15,7.16.7.17). I think that one way to approach this would be to first insert a space after the third character, then it would be easier to manipulate
0 Kommentare
Akzeptierte Antwort
Guillaume
am 21 Jul. 2015
No need to insert spaces, just specify the correct format strings:
x = ['Jul15'; 'Jul16'; 'Aug06'; 'Dec24'];
newx = datestr(datevec(x, 'mmmdd'), 'mm.dd')
Note that your new format is actually worse than the original as it is ambiguous as to which number is the month and which is the day (is it 8th of june or 6th of august?)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Spreadsheets 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!