On using Matlab in solving differential algebraic equations in MHD