Problem 54094. Check if a matrix Diagonal is equal to its secondary diagonal

Your function should return True if the secondary diagonal is equal to diagonal, and False otherwise.
Eg: M = [1 2 1
3 4 4
7 5 7]
The output is True
M=[1 2
1 2]
The output is False. Always check the diagonal top to bottom. Return True if the matrix is empty.

Solution Stats

56.25% Correct | 43.75% Incorrect
Last Solution submitted on Dec 21, 2025

Solution Comments

Show comments

Problem Recent Solvers36

Suggested Problems

Community Treasure Hunt

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

Start Hunting!