MATLAB: Symbolic calculation can’t get merged correctly

matrixsymbolic

I use Matlab Interactive Terminal on VScode
And when I type command lines as follow to calculate a matrix cross product with common symbols, the result seems not merge correctlty
the command line are as follow and here comes the result
>> syms a b c d
>> A=[a b c; b -a d; c d -a;]
>> A=inv(A)
>> B=[-d;-c;-b]
>> A*B

Best Answer

Try simplify()
syms a b c d
A=[a b c; b -a d; c d -a;];
A=inv(A);
B=[-d;-c;-b];
simplify(A*B)
Result
ans =
-(a^2*d + 2*a*b*c + b^2*d + c^2*d - d^3)/(a^3 + a*b^2 + a*c^2 - a*d^2 + 2*b*c*d)
(c*(a^2 - b^2 + c^2 - d^2))/(a^3 + a*b^2 + a*c^2 - a*d^2 + 2*b*c*d)
(b*(a^2 + b^2 - c^2 - d^2))/(a^3 + a*b^2 + a*c^2 - a*d^2 + 2*b*c*d)
Related Question