Given n, create a square matrix and with element (1,1) = 1, add 1 to each element for each horitizonal and vertical movement.
Example:
n = 2;
y = [1 2;
2 3];
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers41
Suggested Problems
-
Extract leading non-zero digit
2253 Solvers
-
Find common elements in matrix rows
2720 Solvers
-
Return the first and last characters of a character array
12339 Solvers
-
Remove the two elements next to NaN value
710 Solvers
-
Replace Nonzero Numbers with 1
453 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!