Transformations of a Large matrix

3 views (last 30 days)
Jessica
Jessica on 25 Nov 2020
Commented: Jessica on 25 Nov 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 Comment
Walter Roberson
Walter Roberson on 25 Nov 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.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 25 Nov 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 Comment
Jessica
Jessica on 25 Nov 2020
Thank You so much for this :D
with the added bonus, for me, that it was a quick reply ^^

Sign in to comment.

More Answers (0)

Categories

Find more on Mathematics and Optimization in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!