I really don't see the point of that kind of problems where you can't use Matlab built-in functions.
which functions?
2418 Solvers
1059 Solvers
Sum of diagonal of a square matrix
1333 Solvers
494 Solvers
Find the Oldest Person in a Room
5736 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!