Automatic computation of Stokes matrices