rot90 in 3D

This function extends the rot90 command to 3D.

You are now following this Submission

This function extends the rot90 command to 3D. So you can rotate a 3D matrix by 90degrees about the x-axis, y-axis, or z-axis. It is kind of hard to visualize in your head but I am pretty sure it works correctly. There is a test matrix included in the comments for the file.

Cite As

Matt Fetterman (2026). rot90 in 3D (https://uk.mathworks.com/matlabcentral/fileexchange/25546-rot90-in-3d), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.4.0.0

Thanks to Jan for sending me this corrected version !

1.3.0.0

updated as suggested by Jan Simon. Makes it faster by removing loops !

1.2.0.0

I corrected the description to clarify that it rotates about x, y, or z-axis.

1.1.0.0

In the comments, the test matrix smoki was not as I had intended.

1.0.0.0