MATLAB: Tranforming
I have a 7x2 matrix that contains data to plot out a shape. So my script is:
myMatrix = ([3,3;4,2;5,1;9,1;5,1;4,2;3,3]);
plot(myMatrix);
axis([-15 15 -15 15]);
I'm trying to translate it down 3 units and left 4 units. So that my shape
will have the points (0,0) as the center. I could move it vertically
simply by creating a new variable and defining it as -3+myMatrix. This
will translate it down 3 units, but I am unable to move it along the
x-axis.
There probably is a simple solution to this but I have been going to the
documentation for matlab and googling but I couldn't find anything that
will help me with this problem.
No comments:
Post a Comment