Here's an example function that rotates an nD array about a specified axis:
main.m1744 chars52 lines
To use this function, pass in the nD array, the desired axis (as an integer), and the rotation angle (in degrees):
main.m125 chars6 lines
This will rotate the 3D identity matrix by 90 degrees about the third axis.
gistlibby LogSnag