Compute trig. function in symbolic matrix
11 views (last 30 days)
I have a symbolic matrix (as shown below). I would like for matlab to compute the trig functions with non-th5 values. How do I go about this.
Thanks in advance.
[ cos(th5), -sin(th5), 0, 0]
[ cos(90)*sin(th5), cos(90)*cos(th5), -sin(90), 0]
[ sin(90)*sin(th5), sin(90)*cos(th5), cos(90), 0]
[ 0, 0, 0, 1]
Walter Roberson on 30 Oct 2015
Are you referring to reducing the sin(90) and cos(90) to the corresponding constant values? Because if you are then you need to take into account that sin() and cos() operate in radians, not in degrees. But this is your purpose then vpa() the symbolic matrix.
If you are wanting to substitute a numeric value for th5 then use subs(), possibly in conjunction with vpa() or double()
subs(TheMatrix, th5, 1.238343) %put in a particular numeric value