필터 지우기
필터 지우기

how can i convert hourly data for a year to daily data?

조회 수: 2 (최근 30일)
ABDULLA RAHIL
ABDULLA RAHIL 2015년 6월 3일
답변: Albatross 2015년 6월 12일
my data start from 1:1:8760 how can i chnge it to daily data with 365 data instead of 8760
  댓글 수: 1
Ingrid
Ingrid 2015년 6월 3일
depends on what you want to do? How do you want to make the conversion. Do you require daily average, daily maximum, daily minimum, value at noon each day, ....

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

채택된 답변

Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2015년 6월 3일
Hi Abdulla,
You may wanna have a look at reshape() function.
Put your data in a column, (apparently its a vector now)
data = data(:); this is one way to make a single column
Than you can reshape your column to a matrix of 360 X N if you like. However 8760 does not generate an integer if divided by 360, so I suggest you pad your data first of all with required number of zeros.
So finally you will have a 360xN data where N is the number of years (about 25 years of data). But keep in mind you will end up with a Matrix.
Hope this helps.
  댓글 수: 3
Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2015년 6월 3일
Abdulla,
I think I forgot that we've 365 days in a year! I confused with 2Pi or 360 degrees! lol
I need to practice the number of finger in one hand, number of days in a month and ... LOL
Anyhow, hope you're problem is solved now that you kindly accepted my answer.
Good luck
ABDULLA RAHIL
ABDULLA RAHIL 2015년 6월 12일
many thanks for your answer but I am struggling to do that even I tried many times , i will send the file to you and see if it is possible or not

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

추가 답변 (1개)

Albatross
Albatross 2015년 6월 12일
I suspect you want to do something like this:
a=1:1:8760;
b=reshape(a,24,365)'

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by