How to Plot seasonal variations using a for loop
Mostrar comentarios más antiguos
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
Respuestas (1)
Rik
el 15 de Nov. de 2017
0 votos
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.
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!