Borrar filtros
Borrar filtros

Matrix transformstion need help

3 visualizaciones (últimos 30 días)
Ashes
Ashes el 3 de Nov. de 2013
Respondida: Youssef Khmou el 3 de Nov. de 2013
I want to do matrix transformation given that
R = [cos(theta), -sin(theta); sin(theta), cos(theta)];
with given
X = [3, -2,0,-2, 3]
and
Y = [0,1,0,-1,0, 0]
I wrote a script so that
R = [cos(theta), -sin(theta); sin(theta), cos(theta)];
X = [3, -2,0,-2, 3]
Y = [0,1,0,-1,0, 0];
plot(R, y);
xlabel('X');
ylabel('Y');
title('Test2d')
grid on

Respuestas (1)

Youssef  Khmou
Youssef Khmou el 3 de Nov. de 2013
Matrix transformation depends on size, if you are working on two dimensional space, then vectors X,Y must be 2x1 : here is an example :
X=[4 4];
Y=[-4 4]
ANGLE=acosd(dot(X,Y)./(norm(X)*norm(Y)))
R=[cosd(ANGLE) -sind(ANGLE);sind( ANGLE) -cosd(ANGLE)]
R*X' % it gives Y

Categorías

Más información sobre Time Series en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by