MATLAB: What is the meaning of ‘simplify(n./d)

MATLABn-d

What is the meaning of 'simplify(n./d)? I feel n./d is weird.
syms x
A=[3/2 (x^2+3)/(2*x-1)+3*x/(x-1);4/x^2,3*x+4]
pretty(simplify(A))
pretty(simplify(n./d)

Best Answer

The expression n./d divides each element of n by the corresponding element of d (with a few caveats to that if they're different sizes.) Since in your example n and d are both sym objects, the result of n./d is also a sym object.
Calling simplify on a sym object attempts to simplify the symbolic expression. In this case, since n and d were created by a call to numden (which extracts the numerator and denominator of a symbolic expression) on the sym object A, n./d should be equivalent to A. If it isn't displayed the same as A initially, simplifying it may make the similarity more pronounced. If you want to check that they're always equal:
isAlways(A == n./d)