Zig-Zag scan

Zig-zag and inverse zig-zag scan as used in Image Processing's JPEG compression.

You are now following this Submission

The functions presented within perform normal zig-zag scanning and the reverse. The normal process converts a matrix of any size into a one-dimensional array by implementing the zig-zag scan procedure.
The inverse function takes in a one-dimensional array and by specifying the desired number of rows and columns, it returns a matrix having the specified dimensions, which would yield the one-dimensional array if the normal zig-zag procedure were implemented.

Works on 2-D matrices of any dimension.

Cite As

Damilola Ogunbiyi (2026). Zig-Zag scan (https://in.mathworks.com/matlabcentral/fileexchange/27078-zig-zag-scan), 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.0.0.0