Making a transformation matrix and using it to rotate vectors

4 views (last 30 days)
Hi so i have little experience with MATLAB so I dont understand the syntax to use and cant find it basically I have to do this
So what i tried to do is this
format short
sym x
R(x)= [cos(x), -sin(x); cos(x), sin(x)]
x=pi/7
A=R(pi/7)
but I end up getting
A =
[ cos(pi/7), -sin(pi/7)]
[ cos(pi/7), sin(pi/7)]
but I want that to be evaluated, what do I do?
Sorry if i sound uneducated with this, I have never used MATLAB before

Accepted Answer

David Hill
David Hill on 2 Oct 2019
Edited: David Hill on 3 Oct 2019
No need to use symbolic here.
x = pi/7;
A =[cos(x),-sin(x);cos(x),sin(x)];
v = [2;-7];
Answer = A*v;

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!