Transformations of a Large matrix

3 visualizaciones (últimos 30 días)
Jessica
Jessica el 25 de Nov. de 2020
Comentada: Jessica el 25 de Nov. de 2020
I have a very long matrix, 2 x1000 double.
I wish to rotate it, and project it - simply - aka like my linear transformations in linear algebra, see minimalistic code
but all solutions I have found are either
  • for square matrices, or
  • image-related, and then I would just copy/paste, I wish to understand what I´m doing.
Can this be done?
A = Matrixfilename
x = A(1,:)
y = A(2,:)
plot(x,y,'.') % gives a figure of a logo
% reflect on x-axis
B = flipud(A)
x2a = B(1,:)
y2a = B(2,:)
plot(x2a,y2a,'.')
% stretching on x-axis
plot(x.*2,y,'r.');
% rotate 140CCW
% project A onto plane N=[1,2,3]
  1 comentario
Walter Roberson
Walter Roberson el 25 de Nov. de 2020
% reflect on x-axis
B = flipud(A)
x2a = B(1,:)
y2a = B(2,:)
That does not reflect on x axes. That exchanges x and y, which is reflection on x=y axes.

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 25 de Nov. de 2020
You have rotation and scale but no translation. You can formulate as
[x(:), y(:)] * A
where A is a 2x2 matrix and * is matrix multiplication. 1000x2 * 2x2 gives 1000x2, which you would split into xprime yprime
For example
A = [0 2; 1 0]
would exchange x and y and multiply the new x by 2
  1 comentario
Jessica
Jessica el 25 de Nov. de 2020
Thank You so much for this :D
with the added bonus, for me, that it was a quick reply ^^

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Mathematics and Optimization en Help Center y File Exchange.

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by