We have some symbolic matrix m, e.g.
m={{1, x, 4 x + y},{0, x y + 4x, 4x},{7 x, x, 4x + x y}}
and we want to produce as output a list of all the unique elements present in m:
desired output:
{1, x, 4 x + y, 0, x y + 4x, 4x, 7 x}
I've tried to use ArrayReshape and ArrayFlatten to convert the matrix into a 1-dimensional list, and then I would hopefully be able to conclude with Union, but so far it isn't working properly.