This function bridges a small but annoying gap between TOEPLITZ, which constructs a Toeplitz matrix from its first row and column, and SPDIAGS, which creates a sparse matrix from its diagonals. SPTOEPLITZ has the same syntax and usage as TOEPLITZ, but it never constructs a dense matrix with more nonzeros than the final result.
Toby Driscoll (2020). Sparse Toeplitz matrix construction (https://www.mathworks.com/matlabcentral/fileexchange/13353-sparse-toeplitz-matrix-construction), MATLAB Central File Exchange. Retrieved .