You have not provided the equations or any matlab code, so I'm just guessing. Happy to help out directly if you can post your actual problem in equations or Matlab code.
There's a really good Matlab toolbox called Symbolic Toolbox. It will solve systems of equations either symbolically, or directly. It's easy to use and understand.