There was NO error returned. It was a WARNING, that while you want to find a solution, none could be found. There are many things in life we may want, but just wanting is not enough to insure something will exist.
In fact, it is pretty easy to show that for general unknown values of the parameters, especially n, no explicit solution interms of radicals will exist as an algebraic expression.
So no, MATLAB cannot solve that problem. But then, neither can any other tool. You cannot solve what is impossible to solve. In fact, it is amazingly easy to write an expression for which no solution can exist. You just did.
If you KNOW numerical values for all of the parameters, thus p,n,x,c,w, then you can supply them, and use a numerical solver. This would be either vpasolve or fzero, although fsolve could also be used. fzero or vpasolve would be better choices.