<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><font face="Palatino" size="4" class="">Hello all, </font><div class=""><font face="Palatino" size="4" class="">I have a relatively simple question on array indexing. </font></div><div class=""><font face="Palatino" size="4" class=""><br class=""></font></div><div class=""><font face="Palatino" size="4" class="">Say, I have an array that is cyclic that contains values from 0 to 360 in steps of 5 degrees (dimension [72]). And I am trying to divide into four quadrants starting from a given theta. Say that the index of the given theta is 13 (out of 73), I define my quadrants that are each 90 degrees as follows : </font></div><div class=""><font face="Palatino" size="4" class=""><br class=""></font></div><div class=""><font face="Palatino" size="4" class="">Array : theta [73]</font></div><div class=""><font face="Palatino" size="4" class="">Quadrant 1 : theta(13:31)</font></div><div class=""><font face="Palatino" size="4" class="">Quadrant 2: theta(31:49)</font></div><div class=""><font face="Palatino" size="4" class="">Quadrant 3: theta(49:67)</font></div><div class=""><font face="Palatino" size="4" color="#ff2600" class="">Quadrant 4: theta(67:13)</font></div><div class=""><font face="Palatino" size="4" color="#ff2600" class=""><br class=""></font></div><div class=""><font face="Palatino" size="4" class="">Now, as you’ll notice, having an index of 67:13 doesn’t imply 67:72 and 0:13, it simply implies 13:67 backwards. How do I index the array such that it takes it in a cyclic fashion? For example (what I don’t want is), in a simpler array of just five dimensions : </font><span style="color: rgb(77, 47, 45); font-family: Courier; font-size: 16px; background-color: rgb(237, 234, 212);" class="">Variable: a</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Type: integer</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Total Size: 20 bytes</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">            5 values</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Number of Dimensions: 1</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Dimensions and sizes:<span class="Apple-tab-span" style="white-space:pre">       </span>[5]</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Coordinates: </span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">(0)<span class="Apple-tab-span" style="white-space:pre">  </span>1</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">(1)<span class="Apple-tab-span" style="white-space:pre">   </span>2</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">(2)<span class="Apple-tab-span" style="white-space:pre">   </span>3</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">(3)<span class="Apple-tab-span" style="white-space:pre">   </span>4</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">(4)<span class="Apple-tab-span" style="white-space:pre">   </span>5</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">ncl 3> print(a(4:2)) </span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212); min-height: 19px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212); min-height: 19px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Variable: a (subsection)</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Type: integer</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Total Size: 12 bytes</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">            3 values</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Number of Dimensions: 1</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Dimensions and sizes:<span class="Apple-tab-span" style="white-space:pre">        </span>[3]</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Coordinates: </span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">(0)<span class="Apple-tab-span" style="white-space:pre">  </span>5</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">(1)<span class="Apple-tab-span" style="white-space:pre">   </span>4</span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Courier; color: rgb(77, 47, 45); background-color: rgb(237, 234, 212);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">(2)<span class="Apple-tab-span" style="white-space:pre">   </span>3</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><font face="Palatino" size="4" class="">What I would have liked it is for it to display 5 1 2 3. </font></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><font face="Palatino" size="4" class=""><br class=""></font></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><font face="Palatino" size="4" class="">Please let me know how this is possible. </font></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><font face="Palatino" size="4" class=""><br class=""></font></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><font face="Palatino" size="4" class="">Thank you all, </font></span></div><div class=""><font face="Palatino" size="4" class="">Prashanth </font></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><font face="Palatino" size="4" class=""><br class=""></font></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div></body></html>