File Exchange

image thumbnail

Zigzag Scan

version (1.56 KB) by Alexey Sokolov
Straight and inverse zigzag scan for matrices of any sizes


Updated 30 Mar 2016

View License

Straight and inverse zigzag scan for matrices of any sizes.
zigzag(in) takes a matrix as an input and returns a one-dimensional array consisting of a zigzag scan results.
izigzag(in, vmax, hmax) takes a one-dimensional array and converts it back to (vmax x hmax) matrix.

Cite As

Alexey Sokolov (2020). Zigzag Scan (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (15)

Alexeq Macsimov

Laura Castro

I needed to calculate block entropy for a CDT encoded image. So thnaks for helping the community, Best Regards, Fabián
Nice work, Dasvidaña!

juveria fatima

if i apply this code on zigzag scan on lena image am not getting the inverse image

Vincent lassena

Truong Nguyen Dang

Ander Cruz

Edward Liang

very clear code


sina saiedi

please help me . I have zigzag scanning program in MATLAB.

Damilola Ogunbiyi

siva kumar

superp....... but need seperation for every scaning group.

xiaolan wong


anonymous anonymous

Excellent work.

Bangalore Akhilesh

Thanks a lot...

Xunkai Wei

Great! But could we further speed it up using vector operation ?

MATLAB Release Compatibility
Created with R12
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!