If you are interested in assigning elements to an existing matrix, you can use tril same way as Shai's answers and combine this with logical indexing. For instance:
A = eye(3); idx = tril(true(size(A)), -1); %
What should give the desired result:
A = 1 0 0 2 1 0 2 2 1
If you are at the stage of creating such a matrix, then you should generate it, as Shay suggests.
source share