In July 2011 I moved to Harvard University to join the School of Engineering and Applied Sciences. My new web page is here.

This MATLAB function allows you to transform the vectors generated by a call to meshgrid in one function call, without looping. Before an after pictures are shown below, to give you an idea as to what this does.

This is a simple plot of a grid generated by meshgrid([-5:0.5:5]).

This is a plot of applying warpmesh to that grid with C = [1.0 0.5; 0.0; 0.8660].

This is the code documentation:
 [W Z] = WARPMESH(X, Y, C)

 Apply a transformation to the output of meshgrid().  The output
 matrices W & Z are such that the matrix C is applied to each 2d
 vector:


 +-      -+     +-      -+
 | W(i,j) |     | X(i,j) |
 |        | = C |        |
 | Z(i,J) |     | Y(i,j) |
 +-      -+     +-      -+

download warpmesh.m