solve matexp