Good problem. You should generalise it with more tests (size of the matrix, different gap...).
I suspect that my solution isn't correct.
This doesn't work..Good for cody!!
Select every other element of a vector
21402 Solvers
263 Solvers
Create a vector whose elements depend on the previous element
405 Solvers
Magic is simple (for beginners)
3228 Solvers
160 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!