I really don't see the point of that kind of problems where you can't use Matlab built-in functions.
which functions?
659 Solvers
261 Solvers
middleAsColumn: Return all but first and last element as a column vector
389 Solvers
Get the length of a given vector
3588 Solvers
Find the Oldest Person in a Room
5222 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!