Matrix commutator.
C = commute(A,B)
This function returns the commutator of its two matrix arguments
A
and B
C = [A,B] = AB - BA.
The commutator [Sx,Sy] of a spin-1/2 is returned by the following code
Sx = sop(1/2,'x'); Sy = sop(1/2,'y'); C = commute(Sx,Sy)
C = 0 + 0.5000i 0 0 0 - 0.5000i
This is obviously equal to iSz.