How to find monthly average from daily data?

조회 수: 10 (최근 30일)
samira jahan
samira jahan 2022년 9월 21일
댓글: Star Strider 2022년 9월 22일
I have a file of 2000 row and 15 columns.First 3 coulmns contain year, month and day.It has 4 years of data of each day. other 12 cloumns contain my variables.This 12 columns has some missing data also.I want to find the monthly average of each variables of each year in one excel sheet.

채택된 답변

Star Strider
Star Strider 2022년 9월 21일
You will need to combine the year, month, and day into one datetime array, and then replace the individual variables with the datetime array. (This should not be difficult with removevars and addvars.) Then use the table2timetable function to convert it to a timetable and then use the retime function.
  댓글 수: 2
samira jahan
samira jahan 2022년 9월 22일
What about the monthly average?
Star Strider
Star Strider 2022년 9월 22일
See the retime documentation section on Aggregate Timetable Data and Calculate Mean Values for an example. With your timetable, you would use 'monthly' instead of 'hourly' as in the documentation example. Other options are in the section on newTimeStep.

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by