Add ddmmm to the year column
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Damith
am 23 Dez. 2015
Kommentiert: Walter Roberson
am 24 Dez. 2015
Hi,
I have a matrix "c" has year column and I need to add "31May" in front of each year in the column. So, the resulting array should look like below: (first two rows are shown). Note that years are not always in a sequence.
How can I achieve this in MATLAB.?
Thanks in advance.
31May1966 5261.9
31May1967 6003.5
0 Kommentare
Akzeptierte Antwort
Andrei Bobrov
am 23 Dez. 2015
out = [arrayfun(@(x)sprintf('31May%d',x),c(:,1),'un',0),num2cell(c(:,2))];
4 Kommentare
Walter Roberson
am 24 Dez. 2015
To check, are you writing a datenum (numeric value) to the column or are you writing a string like '31May1996' to the column?
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!