Average data by time
Afficher commentaires plus anciens
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,
Réponse acceptée
Plus de réponses (1)
Sujay C Sharma
le 17 Juin 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 commentaire
Stefano Alberti
le 17 Juin 2020
Catégories
En savoir plus sur Tables dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!