Zigzag matrix selection
Version 1.0.0.0 (1.96 KB) by
Tyler Stephen
Traverses an mxn matrix in a zigzag order and keeps the first k elements. Others are set to zero.
Written as part of DCT coefficient selection procedure for image compression. Might have other uses.
zigzag([1 2 6 7; 3 5 8 11; 4 9 10 12], 10)
ans =
1 2 6 7
3 5 8 0
4 9 10 0
Cite As
Tyler Stephen (2025). Zigzag matrix selection (https://www.mathworks.com/matlabcentral/fileexchange/61453-zigzag-matrix-selection), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2016b
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
- Image Processing and Computer Vision > Computer Vision Toolbox > Recognition, Object Detection, and Semantic Segmentation > Image Category Classification >
Find more on Image Category Classification in Help Center and MATLAB Answers
Tags
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.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
