MATLAB Answers

Display rotation matrix with s1, c1, etc. in place of sind(theta1), cosd(theta1), etc. respectively.

22 views (last 30 days)
Sourabh Karmakar
Sourabh Karmakar on 11 Apr 2021 at 0:59
Commented: Sourabh Karmakar on 11 Apr 2021 at 3:24
How can I easily display rotation matrix results by s1, c1, etc. in place of sind(theta1), cosd(theta1), etc. respectively. [theta1, theta2 are defined by syms]

Accepted Answer

Paul
Paul on 11 Apr 2021 at 2:09
Use subs:
>> doc subs
>> syms theta1 s1 c1
>> A=[cos(theta1) sin(theta1);-sin(theta1) cos(theta1)]
A =
[ cos(theta1), sin(theta1)]
[ -sin(theta1), cos(theta1)]
>> subs(subs(A,cos(theta1),c1),sin(theta1),s1)
ans =
[ c1, s1]
[ -s1, c1]
  3 Comments

Sign in to comment.

More Answers (0)

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!