Average data by time
Ältere Kommentare anzeigen
Hi all,
I have some problems with a csv file. It's composed by a first column with time and the other by temperature values.
I'd like to create average value for each column by date (now the values are daily, i wanna monthly).
Do you have any suggestions?
I tried with retime comand but I did not have success.
clear all;
close all;
a = readtable ('COR_0200.csv');
tt = timetable(datetime(a.Var1,'InputFormat','yyyy-MM-dd HH:mm:ss')', a);
ttMean = retime(tt,'monthly','mean');
Thanks,
Akzeptierte Antwort
Weitere Antworten (1)
Sujay C Sharma
am 17 Jun. 2020
Hi,
Using the table2timetable function prior to using retime seemed to work when I tried to create a monthly average value for each column using the csv file you have attached. Hopefully this helps you out also.
Data = readtable('COR_0200.csv');
TT = table2timetable( Data, 'rowTimes','Var1' );
MonthlyMean = retime( TT, 'monthly','mean' );
1 Kommentar
Stefano Alberti
am 17 Jun. 2020
Kategorien
Mehr zu Tables finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!