Transformations of a Large matrix
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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
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.
Respuesta aceptada
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
Más respuestas (0)
Ver también
Categorías
Más información sobre Mathematics and Optimization en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!