MATLAB: How to generate a matrix as in the picture

matlab matrix

A is the matrix and n is an arbitrary number that larger than 3,thank you very much!

Best Answer

n = 6; % Let n = 6

z = [-1 3 -3 1];
m = numel(z);
k = n-m+1;
A = full(spdiags(ones(k,1)*z,0:m-1,k,n));
other way with Communications System Toolbox:
n = 6; % Let n = 6
z = [-1 3 -3 1];
A = convmtx(z,n-numel(z)+1);