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

Problem 1211. Create an 'arrow-head" matrix

Created by Khaled Hamed

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]             

Tags

Problem Group

Solution Statistics

63 correct solutions 27 incorrect solutions
Last solution submitted on Jun 26, 2014

Problem Comments

Solution Comments