函數H = my Hankel(c,r)
c = c(:);
nc =長度(c);
如果nargin & lt2,
r =零(大小(c));% -主對角線下方需要零
else if c(NC)~ = r(1)
警告(“MATLAB:Hankel:anti gonal conflict”,【“的最後壹個元素”...
輸入列與輸入行的第壹個元素不匹配。...
\n列贏得反對角線沖突。])
結束
r = r(:);% -力柱結構
nr =長度;
x =【c;r((2:NR)’)】;% -構建用戶數據向量
cidx =(ones(class(c)):NC)‘;
ridx =零(class(r)):(NR-1);
H = cidx(:,ones(NR,1))+ridx(ones(NC,1),:);%漢克爾下標
H(:)= x(H);%實際數據
%%%%%%%%%%%%%%%%%%%%%%%
打電話:
& gt& gtv =【1 2 3 4】
v =
1 2 3 4
& gt& gth =米漢克爾(v)
h =
1 2 3 4
2 3 4 0
3 4 0 0
4 0 0 0