given a value n (say 4) - generate the matrix like below
y= [0 1 2 3 4; -1 0 1 2 3; -2 -1 0 1 2; -3 -2 -1 0 1; -4 -3 -2 -1 0]
Solution Stats
Solution Comments
Show comments
Loading...
Problem Recent Solvers43
Suggested Problems
-
2370 Solvers
-
Replace NaNs with the number that appears to its left in the row.
3069 Solvers
-
Return elements unique to either input
815 Solvers
-
Getting the absolute index from a matrix
259 Solvers
-
Replace every 3rd element in a vector with 4
267 Solvers
More from this Author174
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!