base matalab code for GLF