⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rotlatt.m

📁 Lattice coding and decoding
💻 M
字号:
function varargout = rotlatt(latt,varargin)%ROTLATT Lattice rotation%   RL = ROTLATT(L) applies a rotation operator to the lattice of%   arbitary dimension. %%   RL = ROTTLATT(L,PWR) applies a rotation operator powered to the PWR. %%   [RL,R] = ROTLATT(L,PWR) same as above but also returns rotation%   operator R.%%   Example:%       We verify the relation R^2(Z2) = 2I(Z2) = 2Z2%%       pts = 2 ^ 4;%       Z2 = makelatt('Z',pts,2);%       IZ2 = rotlatt(Z2,2);%       showlatt(Z2,'Style',1); hold on;%       showlatt(Z2,'Labeling','num');%%   See also SPAN, GETPARAMS.%   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>if isempty(varargin) == 1	pwr = 1; % default valueelse	pwr = varargin{1};end[m,n] = size(latt);k = 1:n / 2;l = 1:n / 2 - 1;diag_main = ones(n,1);diag_main(2*k) = -1;diag_lateral = ones(n - 1,1);diag_lateral(2 * l) = 0;R = diag(diag_main) + diag(diag_lateral,1) + diag(diag_lateral,-1);for i = 1:m  rotated(i,:) = latt(i,:) * (R ^ pwr);endvarargout = {rotated,R};

⌨️ 快捷键说明

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