Looping in matlab for months

I have rainfall data for different seasons. I have converted the month names to numbers from 1 to 12. Now in two columns there are starting & ending months of crop sowing. When starting month & ending months are serial & ending month is less than or equal to 12, there is no problem. But how to do the looping for October-January as an instance? I can do from i = 10 to 12 but how to get i =1 again?
Thanks.

 采纳的回答

Jan
Jan 2019-1-29
编辑:Jan 2019-1-29

0 个投票

This sounds like a job for the mod function. Count from 10 to 13, but use mod to limit the output to a certain range.

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Programming 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by