title: Extract arbitrarily rotated plane of data from 3D array as 2D array
body: <p>I have a 3D matrix of data in matlab, but I want to extract an arbitrarily rotated slice of data from that matrix and store it as a 2D matrix, which I can access. Similar to how the slice() function displays data sliced at any angle, except I would also like to be able to view and modify the data as if it were an array.</p>
  
  <p>I have the coordinates of the pivot-point of the plane as well as the angles of rotation (in x, y and z axis), I have also calculated the equation of the plane in the form:</p>
  
  <pre><code>Ax + By + Cz = D
  </code></pre>
  
  <p>and can extract a 3D matrix containing only the data that fall on that plane, but I don't know how to then convert that into a simple 2D array.</p>
  
  <p>Another way of doing it would be to somehow rotate the source matrix in the opposite direction of the angle of the plane, so as to line up the plane of data with the XY axis, and simply extract that portion of the matrix, but I do not know if rotating a matrix like that is possible.</p>
  
  <p>I hope this hasn't been answered elsewhere, I've been googling it all day, but none of the problems seem to exactly match mine.</p>
  
  <p>Thanks</p>