I want to substitute in the following matrix result: A=[diff(theta(t),t) -diff(psi(t),t); -diff(theta(t),t) diff(psi(t),t)] I want to substitute diff(theta(t),t) for a variable called thetap and diff(psi(t),t) for a variable called psip in orden to obtain the following matrix A=[thetap -psip -thetap psip]
then I tried to do this:
theta2 = sym('theta2(t)') psi2 = sym('psi2(t)'
A=[diff(theta(t),t) -diff(psi(t),t); -diff(theta(t),t) diff(psi(t),t)]
dtheta = diff(theta,t) dpsi = diff(psi,t)
Ap_s = subs(A,{dtheta,dpsi},{thetap,psip})
but it doesn't work. It returns again the dependent expression diff(theta(t),t) and diff(psi(t),t) without doing the substitution. I've tried: Ap_s = subs(A,{diff(theta(t),t),diff(psi(t),t)},{thetap,psip}) but it doesn't work. Can anybody help me?