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.

 Accepted Answer

Jan
Jan on 29 Jan 2019
Edited: Jan on 29 Jan 2019
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.

1 Comment

Sir I tried in another way! I will check yours though!

Sign in to comment.

More Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Tags

Asked:

on 29 Jan 2019

Commented:

on 1 Feb 2019

Community Treasure Hunt

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

Start Hunting!