How to define the following matrix like the following?

How to define the following matrix:
the order of matrix is n, In other word, I want define the matrix function of n and i represents the imaginary unit.

You can define a function like so:

bandMatrix[dim_Integer] := Module[{mat},
  mat = SparseArray[{Band[{1, 1}] -> 0, Band[{2, 1}] -> I, Band[{1, 2}] -> I}, {dim, dim}];
  mat[[1, dim]] = mat[[dim, 1]] = 1;
  Return[Normal[mat]]
  ]

Very thanks to you

Band[{1, 1}] -> 0 can be omitted, certainly. Also, you can put in the assignments of the corner elements in SparseArray[] itself. Thus,

With[{n = 5}, 
     SparseArray[{Band[{2, 1}] -> I, Band[{1, 2}] -> I,
                  {1, -1} -> 1, {-1, 1} -> 1}, {n, n}]] // MatrixForm