span.m

来自「Lattice coding and decoding」· M 代码 · 共 40 行

M
40
字号
function vs = span(patt,dim)%SPAN Linear combinations spanned over N-dimensional vector space%   VS = SPAN(PATT,DIM) expands the pattern patt and creates all the%   linear combinations over the $n$-dimensional vector space. %%   Note: Such combinations could be also obtained via standard MATLAB%         functions (see the code below). But there are certain%         restrictions you should know about.  PERMS function is%         practically usable only when its argument is less that about 10.%         Furthermore for higher dimensions the computation via PERMS%         function is too slow and moreover it doesn't produce the same%         result as the SPAN function.%%         vs = span([0:2],3)%         x = perms(0:2);%         [m,n] = size(x);%         k = m * n / 3; %         x = reshape(x,[3 k]); %         x = sortrows(x');%%   See also BLUR, CLUSTER.%   Copyright 2001-2003 Kamil Anis, anisk@feld.cvut.cz%   Dept. of Radioelectronics, %   Faculty of Electrical Engineering%   Czech Technical University in Prague%   $Revision: 0.1 $  $Date: 2003/1/16 17:33:28 $%   --%   <additional stuff goes here>m = length(patt);for i = 1:dim    k = abs(i - dim);    l = i - 1;    z = cluster(patt',m ^ k,m ^ l);    vs(:,i) = z;end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?