how to rotate matrix scroll by 90 degrees in code

I'm sorry I don't follow.....how would you rewrite it