Mercurial > hg > ishara
annotate general/numerical/matrix/circulant.m @ 35:f1ce7876346a
Updated docs.
author | samer |
---|---|
date | Mon, 21 Jan 2013 11:01:45 +0000 |
parents | db7f4afd27c5 |
children |
rev | line source |
---|---|
samer@4 | 1 function t=circulant(c) |
samer@4 | 2 % circulant - Construct circulant matrix from first column |
samer@4 | 3 % |
samer@4 | 4 % circulant :: [[N]] -> [[N,N]]. |
samer@4 | 5 |
samer@4 | 6 m = length(c); |
samer@4 | 7 c=c(:); |
samer@4 | 8 |
samer@4 | 9 x = [c(2:m) ; c(:)]; % build vector of user data |
samer@4 | 10 cidx = (0:m-1)'; |
samer@4 | 11 ridx = m:-1:1; |
samer@4 | 12 t = cidx(:,ones(m,1)) + ridx(ones(m,1),:); % Toeplitz subscripts |
samer@4 | 13 t(:) = x(t); % actual data |
samer@4 | 14 |
samer@4 | 15 |