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