lua lab to do matrix calculations