Write a function that when given an odd number, produces an arrow-head function pointing to the right.

Examples

n = 3

output

         [1  0
          0  1
          1  0]

n = 5

output

                [ 1   0   0
                  0   1   0
                  0   0   1  
                  0   1   0
                  1   0   0]             

Solution Stats

272 Solutions

136 Solvers

Last Solution submitted on Apr 27, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers136

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!