How to Plot seasonal variations using a for loop
이전 댓글 표시
Hi everyone, i have representative concentration pathway data from the IPCC. the data is arranged: 1890 jan feb march april may.. ... 2100 so a column for year and 12 rows (one number in each) for each year. Im trying to work out winter mean over the time period, however december is located in the previous line to jan and feb. How can i code this in the for loop? for the others i have used: for i= 1:240 spring(i)= mean(data(i,3:5)) Thanks Ben
답변 (1개)
Rik
2017년 11월 15일
0 개 추천
Convert the subs of jan-mar to indices (see doc sub2ind), subtract 1, and there you are. Don't forget to add a special case for the first year.
I don't have time right now to write some example code, so let me know if this explanation is enough to get you going.
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!