Cody

Problem 1211. Create an 'arrow-head" matrix

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

66.67% Correct | 33.33% Incorrect
Last solution submitted on Oct 08, 2016

Problem Comments

Solution Comments

Tags

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Join the 15-year community celebration.

Play games and win prizes!

Learn more