필터 지우기
필터 지우기

converting 1 hourly data to 3 hourly data

조회 수: 1 (최근 30일)
janakiram Reddy
janakiram Reddy 2019년 9월 27일
편집: Ajay Kumar 2019년 9월 27일
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
darova
darova 2019년 9월 27일
Can you please show what you have done already?

댓글을 달려면 로그인하십시오.

답변 (1개)

Ajay Kumar
Ajay Kumar 2019년 9월 27일
편집: Ajay Kumar 2019년 9월 27일
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
janakiram Reddy
janakiram Reddy 2019년 9월 27일
thanks for help kumar, it is working.
Ajay Kumar
Ajay Kumar 2019년 9월 27일
편집: Ajay Kumar 2019년 9월 27일
My pleasure.
Please accept the answer if you got what you need. Thanks :)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by