I really don't see the point of that kind of problems where you can't use Matlab built-in functions.
which functions?
1400 Solvers
626 Solvers
Multiples of a Number in a Given Range
215 Solvers
find the maximum element of the matrix
349 Solvers
2148 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!