I really don't see the point of that kind of problems where you can't use Matlab built-in functions.
which functions?
10451 Solvers
Project Euler: Problem 3, Largest prime factor
420 Solvers
Find the sum of the elements in the "second" diagonal
1006 Solvers
224 Solvers
422 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!