converting 1 hourly data to 3 hourly data

3 visualizaciones (últimos 30 días)
janakiram Reddy
janakiram Reddy el 27 de Sept. de 2019
Editada: Ajay Kumar el 27 de Sept. de 2019
I have file of excel with date,hour,waveheight i need to convert avg of three hourly data set i.e each day i will get 8x3(8 data sets) instead of 24x1 (24 data sets) can anyone help me out in writing code since i am new to matlab. attached file also.
Any kind of help will be useful for me
thanks
janakiram
  1 comentario
darova
darova el 27 de Sept. de 2019
Can you please show what you have done already?

Iniciar sesión para comentar.

Respuestas (1)

Ajay Kumar
Ajay Kumar el 27 de Sept. de 2019
Editada: Ajay Kumar el 27 de Sept. de 2019
data = xlsread('www3');
data = data(:,2);
j=1;
try
for i = 1: fix(length(data))
newdata(i) = mean(data(j:j+2));
j=j+3;
end
catch
end
newdata = newdata';
new data has 2912 values. Each is average of 3 hours of original data.
  2 comentarios
janakiram Reddy
janakiram Reddy el 27 de Sept. de 2019
thanks for help kumar, it is working.
Ajay Kumar
Ajay Kumar el 27 de Sept. de 2019
Editada: Ajay Kumar el 27 de Sept. de 2019
My pleasure.
Please accept the answer if you got what you need. Thanks :)

Iniciar sesión para comentar.

Categorías

Más información sobre Workspace Variables and MAT-Files en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by