N x N identity matrix in MATLAB

Viewed 269

I am having difficulty creating a generic N x N identity matrix in Matlab.

I am given a system where

Ai,j =

{1, if i does not equal j

{n, if i = j}

You are asked to compute this when the value of the identity matrix n = 10, n = 20.

What I don't see is how to apply matrix indexing here. That is easy enough to do, but how do I account for the given linear system?

1 Answers
Related