Code covered by the BSD License  

Highlights from
QUBIT4MATLAB V4.0

from QUBIT4MATLAB V4.0 by Geza Toth
MATLAB package for quantum information science and quantum mechanics.

c=comm(A,B)
%comm Commutator of two matrices.
%   comm(A,B)=AB-BA gives the commutator of A and B.

function c=comm(A,B)
c=A*B-B*A;

Contact us at files@mathworks.com