Making a transformation matrix and using it to rotate vectors

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

 Akzeptierte Antwort

David Hill
David Hill am 2 Okt. 2019
Bearbeitet: David Hill am 3 Okt. 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;

Weitere Antworten (0)

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by