MATLAB: How to create a matrix

matrix creating

Hi all, I am trying to create a matrix (101×101) like this :
Can anyone help me with the code please?

Best Answer

n=4 % in your case use n=101
out=tril(2*ones(n),-1)