What you want to solve is a partial differential equation (EQS or MQS equations). In matlab, PDEtool may help you. However, I think it can solves 2D problem only. New vision like 2016b or later may solve 3D problem, but I am not sure. Personally, Comsol, which originates from PEDtool, is a better tool to your simulation.