Line | |
---|
1 | function t = toeplitz(c,r) |
---|
2 | %TOEPLITZ (overloaded) |
---|
3 | |
---|
4 | % Author Johan Löfberg |
---|
5 | % $Id: toeplitz.m,v 1.5 2006/02/05 13:21:29 joloef Exp $ |
---|
6 | |
---|
7 | % direct 1-to-1 copy of MATLAB double code |
---|
8 | if nargin < 2, |
---|
9 | c.basis(1,:) = conj(c.basis(1,:)); |
---|
10 | r = c; |
---|
11 | c.basis = conj(c.basis); |
---|
12 | % c(1) = conj(c(1)); |
---|
13 | % r = c; |
---|
14 | % c = conj(c); |
---|
15 | end |
---|
16 | r = reshape(r,prod(size(r)),1);%r(:) |
---|
17 | p = length(r); |
---|
18 | m = length(c); |
---|
19 | x = [extsubsref(r,p:-1:2) ; reshape(c,prod(size(c)),1)]; |
---|
20 | cidx = (0:m-1)'; |
---|
21 | ridx = p:-1:1; |
---|
22 | t = cidx(:,ones(p,1)) + ridx(ones(m,1),:); |
---|
23 | t = extsubsref(x,t); |
---|
24 | if isa(t,'sdpvar') |
---|
25 | t.conicinfo = [0 0]; |
---|
26 | end |
---|
27 | |
---|
Note: See
TracBrowser
for help on using the repository browser.