Create an arrow matrix - MATLAB Cody - MATLAB Central

Problem 54440. Create an arrow matrix

Difficulty:Rate
An arrow matrix is a square matrix that contains ones on the diagonal, the last column, and last row.
Write a function that takes the number of rows and columns (for N >= 3) as an input, and returns the corresponding arrow matrix.

Solution Stats

68.17% Correct | 31.83% Incorrect
Last Solution submitted on Jun 23, 2025

Problem Comments

Solution Comments

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

Problem Recent Solvers451

Suggested Problems

More from this Author12

Community Treasure Hunt

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

Start Hunting!