The function $G_\mathrm{cleaned}=fCleanupsys(G,tol)$ takes the system $G=ss(A,B,C,D)$ and sets the entries of the state space matrices whose absolute values are smaller than $tol$ to zero.
Note: This is a quick and dirty type function that is sometimes useful in practice. Obviously, this function must be applied with care.