Let's say you are given an NxN square matrix where N is always going to be an odd number:
x = [ 1 2 3
4 5 6
7 8 9 ]
Your function should return 5.
Edge Case: Your solution must be able to handle empty matrices, and return a NaN in that case like:
% Input Matrix
x = []
% Correct answer returned by your function
y = NaN
Solution Stats
Problem Comments
1 Comment
Solution Comments
Show comments
Loading...
Problem Recent Solvers28
Suggested Problems
-
7483 Solvers
-
Back to basics - mean of corner elements of a matrix
465 Solvers
-
Matlab Basics II - Determine if an array has a 3rd dimension
167 Solvers
-
Sum the squares of numbers from 1 to n
261 Solvers
-
958 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
The problem description doesn't match the test suite --- the input matrix can in fact be non-square.