MATLAB: Extract a parallel planes of elements from a 3D array

arraysImage Processing Toolboxplanes

I have a 3D array of numbers. I want to define a rectangular plane through that 3D structure, rather I specify two lines that make up the sides of the rectangular plane.Planes parallel to this specified plane should slice through the 3D structure and the output obtained should be an array like the input I had given but with the elements rearranged accordingly.
I would appreciate some help on how to go about this task.

Best Answer

Use TFORMARRAY, if you have the image processing toolbox.