Given a vector vec, create a v-shaped vector as shown below: vec = [ 10 2 3 89 5 7 90 0 12]
Output vector = [90 89 12 10 7 5 3 2 0 0 2 3 5 7 10 12 89 90]
Here, all the elements of input vector are repeated in output vector, however first half part of the output vector is in descending order and rest is in ascending order. Once such output vector is plotted, it will show a v-shape on the graph.
Do not use builtin sort function

Solution Stats

116 Solutions

33 Solvers

Last Solution submitted on Jun 21, 2024

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers33

Suggested Problems

More from this Author25

Community Treasure Hunt

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

Start Hunting!