Count up then down - MATLAB Cody - MATLAB Central

Problem 1077. Count up then down

Difficulty:Rate

Create a function that produces counting up from 0 up to n then down to 0

n=2 --> 0 1 2 1 0

n=3 --> 0 1 2 3 2 1 0

Solution Stats

49.41% Correct | 50.59% Incorrect
Last Solution submitted on Jun 18, 2025

Problem Comments

Solution Comments

Show comments
Why should you share code?
In a discussion on LInkedin about my recent blog post, Do these...
2
3

Problem Recent Solvers385

Suggested Problems

More from this Author11

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!