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

66.67% Correct | 33.33% Incorrect
Last Solution submitted on Feb 28, 2025

Solution Comments

Show comments

Problem Recent Solvers10

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