Simple 1-D Pn solver written in MATLAB