MATLAB Symbolic Toolbox automatically re-arranges expressions into "canonical form" in order to make it simpler to share parts of expressions (which in turn makes it more efficient to process expressions, since the repeated parts only have to be processed once.)
The canonical form for polynomials involves sorting each term in alphabetical order, then sorting the terms in alphabetical order, modified by the rule that the first term must normally have a positive coefficient. You can only get a leading negative if all of the terms are negative
>> -Z1+Z_1 - Z10 - Z_10
ans =
Z_1 - Z10 - Z1 - Z_10
>> -Z1-Z_1 - Z10 - Z_10
ans =
- Z1 - Z10 - Z_1 - Z_10
However, when forming rationals, the rule is a bit different: if the leading term of the denominator (as determined by sorting in alphabetical order) would normally be negative, then the negative of the denominator is formed, and the negative of the numerator is taken.
Your denominator is Z_2*Z_3 - Z_1*Z_4 which would sort into -Z_1*Z_4 + Z_2*Z_3 . Because it is the demonator, the negative is taken forming Z_1*Z_4 - Z_2*Z_3 and the negative of the numerator is taken. All of the terms of the numerator are then negative so you get the leading negative together with all positive terms.
You cannot get it to show you the denominator as Z_Z*Z_3 - Z_1*Z_4 because that would violate the rule that for denominators the terms are always sorted alphabetically