Matrix Rotation by 90 Degrees - MATLAB Cody - MATLAB Central

Problem 60813. Matrix Rotation by 90 Degrees

Difficulty:Rate
In this problem, you are tasked with rotating a given matrix by 90 degrees in a counter-clockwise direction. The input will be a square matrix (i.e., the number of rows is equal to the number of columns), and you need to return a new matrix that is rotated by 90 degrees.Input:
  • A: A square matrix of size n x n (where n is a positive integer). The matrix A contains numerical values.
Output:
  • The function should return a new matrix, B, which is the original matrix A rotated by 90 degrees counter-clockwise.

Solution Stats

70.0% Correct | 30.0% Incorrect
Last Solution submitted on Mar 24, 2025

Solution Comments

Show comments
Who Deserves Your Praise? Discover the New Contribution Widget!
...
We are excited to announce another update to our Discussions area: the...

Problem Recent Solvers12

Suggested Problems

Community Treasure Hunt

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

Start Hunting!
Go to top of page