Following code is to derive an expression for the derivative of the magnitude of a vector function of time.
r = symfunmatrix('r(t)',t,[3,1]);
R = symfunmatrix('R(t)',t,[1,1]);
eqn = R(t)^2 == (r.'*r)
eqn(t) = 
eqn = diff(eqn)
eqn(t) =

At this point, it would be nice if @doc:isolate worked for matrix equations, but it doesn't, so proceed by hand
eqn = lhs(eqn)/Rx2 == rhs(eqn)/Rx2
eqn(t) =

Why doesn't the software automatically simplify the lhs to just diff(R) as it would for a scalar equation?
It's almost as if the software does not know that matrix multipliation is associative (see below).
We could proceed by explicitly converting the lhs to symfun, but shouldn't have to.
symfunmatrix2symfun(lhs(eqn)) == rhs(eqn)
ans(t) =

Also, if the lhs wern't a scalar then I think the conversion to symfun would result in the lhs defined in terms of its elements, which would be annoying at best and unworkable at worst depending on the dimensions of the problem.
Recognizing that r(t)*inv(R(t)) is a unit vector (don't worry about the case where R(t) == 0)
r_hat = symfunmatrix('r_hat(t)',t,[3,1]);
eqn3 = r_hat == r/R
eqn3(t) = 
then substitute
eqn = subs(eqn,rhs(eqn3),lhs(eqn3))
eqn(t) =

Lo and behold, the substitution simplifies the lhs. I'm happy that the lhs did simplify, but I'd like to understand why it simplified (and why it did not simplify upstream in the development).
Getting back to that idea of the associative property of matrix multiplication, with R defined as symfunmatrix
diff(R)*(R/R)
ans(t) =

(diff(R)*R)/R
ans(t) =

Oddly enough, it appears that the preceding result is related to R(t) being 1 x 1. No problem with a symfunmatrix of larger dimension
R = symfunmatrix('R(t)',t,[2,2]);
(diff(R)*R)/R
ans(t) =
