Given a square matrix as input, write a function that returns the sum of all elements above the main diagonal.
If the input matrix is empty ([]), the output must also be empty ([]).
Your solution must use exactly one for loop.
Note: Some built-in MATLAB functions are disabled for this problem.

Solution Stats

6 Solutions

5 Solvers

Last Solution submitted on Jul 14, 2026

Last 200 Solutions

Solution Comments

Show comments
Loading...