Definition of Time
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a file data with:
Column1: Year (2011)
Column2: Month (10)
Column3: Day (22)
Column4: Hour (10)
Column5: Minute (35)
Column6: Second (30)
These are "86400x1 double" so a lot of data.
I want to have a variable or another cell with TIME like:
YYYY.MM.DD HH.MM.SS (2011.10.22 10.35.30)
How could I concatenate or merge all elements?
I need to use it after that to find the DATE and TIME (X) in the database and to delete until the next (Y) value TIME. At the end I have to plot all and have an average of temperatures (The data has also some columns with temperatures)
Thank you
3 Kommentare
Akzeptierte Antwort
Dr. Seis
am 7 Mär. 2012
DateNumber = datenum([Y, M, D, H, MN, S])
So...
X = datenum(data(:,1:6))-min(datenum(data(:,1:6))); % Normalized time
Y1 = data(:,7);
Y2 = data(:,8);
X is time in terms of fraction of a day - to get X in terms of seconds, multiply by 24*60*60
Weitere Antworten (1)
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!