TwoTimeG2 Two time g2 code in matlab using parallel processing if available (includes GPU if suitable)