How can I transform these data into seasonal data?
이전 댓글 표시
Hello everyone,
I should transform monthly data into seasonal data and yearly data into seasonal data: [1) December-January; 2) From March to October; 3) November; 4)February] and then doing the average.
Can anyone help me kindly?
Thank you.
댓글 수: 6
Wan Ji
2021년 8월 15일
What do all the mat files mean by their names, not so clear
Scott MacKenzie
2021년 8월 15일
편집: Scott MacKenzie
2021년 8월 15일
I believe you have asked this question before, and it has been answered (click here). Please explain how this new question differs from the previous question.
Pul
2021년 8월 16일
Scott MacKenzie
2021년 8월 16일
OK, I get it. You are now working with new data which are organized differently. Well, step #1 is always to know and understand the organization of the data you are working with. Some fiddling might be necessary to get the data organized in a way that suits your purpose.
The load command in your comment loads data into a table (not a timetable). Upon inspection, I notice there is no datetime column, so you'll have to make one. In this case, columns 1 and 2 are 'Year' and 'Month'. So, you need to make and add a datetime column from these columns. Then you can convert to a timetable, and continue with the code in the answer to your earlier question; i.e., define your seasons, use grpstats to get seasonal summaries, plot, etc.
Here's some code to get you started with the data in your comment.
load('DATI_MAR_mensili');
% NOTE: loads a table with 'Year' and 'Month' columns
% add date/time column labeled 'Time'
DATIMARmensili.Time = datetime(DATIMARmensili.Year, DATIMARmensili.Month, 0);
% convert to timetable with all the other data columns
DATI_MAR_SEASON = table2timetable(DATIMARmensili(:,3:end));
% define seasons, as in previous question/answer, and continue
Scott MacKenzie
2021년 8월 16일
OK, I'll also put the code from my comment into answer box.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!