East Lansing — To say this season has been a bit of a roller-coaster for Michigan State’s secondary would be an understatement.

After several years of being the rock in Michigan State’s defense, this season the back end for the Spartans has been through its share of challenges.

Through it all, however, has been junior Demetrious Cox.

While injuries and inconsistent play hampered the secondary, Cox has started all 13 games this season — eight coming at cornerback and five at safety.

“If Day-Day came out, it was because a fast-paced offense or tempo-type thing where we just rolled him,” Michigan State coach Mark Dantonio said. “But he’s been a mainstay back there for us.”

Cox, a safety by trade, came out of preseason camp as one of the top two options at cornerback with fifth-year senior RJ Williamson and sophomore Montae Nicholson manning the safety spots. He moved back to safety for the first two Big Ten games but was back at corner by the Michigan game when junior Darian Hicks was lost to a concussion.

When Hicks returned against Ohio State, Cox went back to safety, the spot he’ll man when No. 3 Michigan State takes on No. 2 Alabama in the Cotton Bowl.

Through it all, there were freshmen to break in — Khari Willis and Grayson Miller at safety — while Nicholson worked through some rough play to regain his starting spot.

Needless to say, Cox needed to be consistent. He has 72 tackles this season, as well as his share of big plays. He returned a fumble 77 yards for a touchdown against Penn State and had an interception in the end zone against Iowa in the Big Ten title game.

It was just what Michigan State needed from a guy who could only recall coming off the field once — in the season opener at Western Michigan.

“I remember (linebacker) Riley (Bullough) hit me one time,” Cox said. “I thought I had a concussion. I was like, ‘I gotta come out.’

Cox said he’s had his share of minor injuries throughout the season, but none has slowed him down. And now he’ll have the benefit of Williamson returning after suffering a torn biceps in the Big Ten opener against Purdue.

“RJ brings so much energy,” Cox said. “He’s so smart on the field.”

But it was Williamson’s absence that has helped the secondary, Cox said, including allowing him to play wherever he has been needed.

“You have to throw the guys into the fire,” Cox said. “Montae, Grayson … all those guys came out ready to play. They’ve played really well.”