For a given input n, make an n by n identity matrix that contains the elements 1:n along its diagonal. For example, if input=5:
output = [1 0 0 0 0; 0 2 0 0 0; 0 0 3 0 0; 0 0 0 4 0; 0 0 0 0 5]
This problem's title and description were cleaned up and additional test cases were added.
Find all elements less than 0 or greater than 10 and replace them with NaN
11633 Solvers
205 Solvers
find the maximum element of the matrix
254 Solvers
325 Solvers
185 Solvers