function A = mytoeplitz(c,r) if (nargin == 1) r = c; c = conj (c); c(1) = conj (c(1)); endif if (r (1) != c (1)) warning ("toeplitz: column wins diagonal conflict"); r(1) = 0; endif n = length(c); c = c(:).'; r = r(:).'; cidx = find(c); ridx = find(r); A = spdiags(repmat(full(c(cidx)),n,1),1-cidx,n,n)+... spdiags(repmat(full(r(ridx)),n,1),ridx-1,n,n);