Hello,
I have a 3×3 symbolic matrix T1. I want to replace theta1 with theta1(t), theta2 with theta2(t) in my matrix. I tried using the subs function like so
syms theta1 theta2 theta3AT1 = subs(T1, {theta1, theta2, theta3},... {theta1(t), theta2(t), theta3(t)})%--------------- My T1 is-----------
[ cos(theta1 + theta2 + theta3), sin(theta1 + theta2 + theta3), 0, 8*cos(theta1 + theta2 + theta3) + 5*cos(theta1 + theta2) + 10*cos(theta1)][ -sin(theta1 + theta2 + theta3), cos(theta1 + theta2 + theta3), 0, - 8*sin(theta1 + theta2 + theta3) - 5*sin(theta1 + theta2) - 10*sin(theta1)][ 0, 0, 1, 0][ 0, 0, 0, 1]
but matlab expects an arithmetic expression as the input function in "subs", hence throws an error.
A workaround I thought of, was calling elements individually and converting them, but however I try an error shows up when I use brackets. By which I mean 'theta1' can be replaced by 'theta4' but not 'theta4(t)'.
In the end I need to differentiate T1, so theta has to be theta(t) for "diff" function to work properly
Please let me know how I can solve this issue.
PS: It is also fine if there is some way I can call elements of the matrix below, but I don't think it is possible
>> T10 T10(t) = [ cos(theta1(t)), sin(theta1(t)), 0, 10*cos(theta1(t))][ -sin(theta1(t)), cos(theta1(t)), 0, -10*sin(theta1(t))][ 0, 0, 1, 0][ 0, 0, 0, 1]
Thanks,
Venkatesh.
Best Answer