I am trying to use a do loop with if/else statements to create a 5x5 unit matrix. I made an empty array. Converted it to a matrix. Then made a do loop where I was trying to get the matrix elements where i=j to be 1 and all else to be 0. It didn't spit out a matrix.
Any advice? I assume I must have missed a small detail in syntax.
By the way, I am open to completely different methods, also! I was just trying to use loops to do it rather than inbuilt commands.