This is a really ugly way to solve the problem, not very helpful to many people in learning MATLAB
9968 Solvers
Make a run-length companion vector
519 Solvers
Sum the numbers on the main diagonal
457 Solvers
493 Solvers
2186 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!