I got tired of solving these problems. So, I just wrote a solution that works for everything.
952 Solvers
Get the elements of diagonal and antidiagonal for any m-by-n matrix
268 Solvers
2545 Solvers
376 Solvers
2625 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!