?? rotlatt.m
字號(hào):
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};
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -