you can simply save the data created by matpower etc (but I have matpower)
However, you start by simplifying the code by removing everything which doesn't cause the error, which typilaccy will give you a very small infeasible model, and then it will often be obvious what is wrong