This code NEEDS TO BE DONE IN MATLAB!!!!
Write a function that takes one input, an integer number n, andreturns a matrix that is nxn, where the value of each number is thedistance from the upper-left to bottom-right diagonal. (Use whileloops if you can!)
Numbers below the diagonal should be negative, and numbers abovethe diagonal should be positive.
For example, if your input was 5, your output would be:
0 1 2 3 4
-1 0 1 2 3
-2 -1 0 1 2
-3 -2 -1 0 1
-4 -3 -2 -2 0
Expert Answer
An answer will be send to you shortly. . . .
PayPal Gateway not configured
PayPal Gateway not configured