Rice flour (18-25% moisture) and potato starch (20% moisture) were heated with continuous recording of the X-ray scattering during gelatinization. Rice flours displayed A-type crystallinity, which gradually decreased during gelatinization. The development of the characteristic 9 nm small-angle X-ray scattering (SAXS) peak during heating at sub-gelatinization temperatures indicated the gradual evolution into a stacked lamellar system. At higher temperatures, the crystalline and lamellar order was progressively lost. For potato starch (B-type crystallinity), no 9 nm SAXS peak was observed at ambient temperatures. Following the development of lamellar structures at sub-gelatinization temperatures, B-type crystallinity and lamellar order was lost during gelatinization. On cooling of partially gelatinized potato starch, A-type crystallinity steadily increased, but no formation of stacked lamellar structures was observed. Results were interpreted in terms of a high-temperature B- to A-type recrystallization, in which the lateral movement of double helices was accompanied by a shift along their helical axis. The latter is responsible for the inherent frustration of the lamellar stacks.