Rotate a Matrix by 90 degrees

Example:

If the input is:

X =

    1    2    3
    4    5    6
    7    8    9

So the answer would be:

Y =

    3    6    9
    2    5    8
    1    4    7

Solution Stats

1422 Solutions

984 Solvers

Last Solution submitted on Apr 08, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers984

Suggested Problems

More from this Author11

Problem Tags

Community Treasure Hunt

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

Start Hunting!