How to average seconds data to minutes data?
Mostrar comentarios más antiguos
I have a set of data with me. I want to average this seconds data into minutes average data.
I used following code, but I didn't get.
Z=xlsread('V.csv',-1);
nhours=1;
Ts=1;
data=[Z];
meanT=60;
data=rand(3600,1);
matrix=reshape(data,3600/Ts,nhours);
out=mean(matrix(1:meanT/Ts,:))
I want help and its urgent. Find the data file attached.
2 comentarios
Guillaume
el 11 de Dic. de 2017
Well, for something urgent, you certainly haven't made much of an effort. Do you even understand the code you've written, particularly the line
data = rand(3600, 1)
where you replace what you've just read from the file by one column of random data?
Kraunchaa
el 11 de Dic. de 2017
Respuesta aceptada
Más respuestas (1)
Guillaume
el 11 de Dic. de 2017
Honestly, I doesn't look like you've made much effort. Nearly none of the line you've written make any sense. Particularly the one where you replace the whole of the content of the file you've read by random data.
It's very easy to do with timetables:
tt = table2timetable(readtable('V.csv', 'Format', '%{HH:mm:ss}D%f'));
tt_minutely = retime(tt, 'minutely', 'mean')
1 comentario
Kraunchaa
el 19 de Dic. de 2017
Categorías
Más información sobre Time Series Events en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!