//  This routine takes a given set of data points stored in vectors x and y
//  and applies the 2-D transformation stored in the matrix A.

//  First, we store the data points in column vector format.  For simplicity, we
//  will store them in one matrix of columns called 'pts'

//  If one does not have vectors to play with, uncomment the following lines to test:

//  x = 0:0.1:6.3;
//  y = sin(x)+1;
//  A = [2 0; 0 -2];

tempx = size(x);
if tempx(1)==1
  x = x';
end
tempy = size(y);
if tempy(1)==1
  y = y';
end

//  Now that the data point vectors are in column format, 
//  create the matrix of original vectors
pts = [x y]';

//  Ok, now let's apply the transformation indicated by the matrix A to the entire
//  set of data vectors at one time.

z = A*pts;

//  Finally, let's plot the original points in BLUE and the transformed points in RED.

plot(x,y,'b.',z(1,:),z(2,:),'r.')
