Tent matrix - MATLAB Cody - MATLAB Central

Problem 43656. Tent matrix

Difficulty:Rate

Create an n x n matrix that resembles one kind of tent. The variable n is provided to the function and will be an odd number. As an example, if n=5:

 surround(5) = 1  2  3  2  1
               2  3  4  3  2
               3  4  5  4  3
               2  3  4  3  2
               1  2  3  2  1

Solution Stats

47.4% Correct | 52.6% Incorrect
Last Solution submitted on Mar 03, 2025

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers75

Suggested Problems

More from this Author1

Problem Tags

Community Treasure Hunt

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

Start Hunting!
Go to top of page