JMAT - Computes antisymmetric Matrix [O 1; -1 0] INPUTS 1. dim - 1,2,3 Dimension of the sqare matrix OUPUTS 2. mat - Antisymmetric block Matrix [O 1; -1 0] See also symplectify
0001 function mat=jmat(dim) 0002 % JMAT - Computes antisymmetric Matrix [O 1; -1 0] 0003 % 0004 % INPUTS 0005 % 1. dim - 1,2,3 Dimension of the sqare matrix 0006 % 0007 % OUPUTS 0008 % 2. mat - Antisymmetric block Matrix [O 1; -1 0] 0009 % 0010 % See also symplectify 0011 0012 S2 = [0 1; -1 0]; 0013 0014 if(dim==1) 0015 mat=[0 1;-1 0]; 0016 elseif(dim==2) 0017 mat = blkdiag(S2,S2); 0018 elseif(dim==3) 0019 mat = blkdiag(S2,S2,S2); 0020 else 0021 Error('Dim is 1, 2 or 3') 0022 end