Updated 24 Mar 2010
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.
Damilola Ogunbiyi (2023). Zig-Zag scan (https://www.mathworks.com/matlabcentral/fileexchange/27078-zig-zag-scan), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.