convert to monthly mean (arrange data)
이전 댓글 표시
I attached here 2 text files ..one is input file(complete data of year,month number,Day1 to day31) and second one is output file(year, month wise mean).I want this output format only.
댓글 수: 6
Guillaume
2014년 9월 22일
What is the difficulty you're facing? Looks as simple as averaging column 3 onwards of each row.
skyhunt
2014년 9월 22일
Geoff Hayes
2014년 9월 22일
Start with importdata to load the data from each file into local variables (structures). The data field of each of these structures will have the numeric data. As some of your columns (for certain rows) are empty, then these will be replaced with NaN.
Then as Guillaume suggested, take the average of each row (only from the input.txt file) from the third column onwards. If you have the Statistics Toolbox, consider using nanmean which will take the average of a set of numbers, ignoring any Nan values. If you don't have this function, then you can write an equivalent version using mean as a guide.
skyhunt
2014년 9월 23일
Geoff Hayes
2014년 9월 24일
What happened when you loaded the data from file using importdata? Please post some or all of the code that you have written to accomplish this task.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!