ZigZag - 02 - MATLAB Cody - MATLAB Central

Problem 45401. ZigZag - 02

Difficulty:Rate

Given a matrix, return the elements that are on the Z form of the matrix. For example -

 a=[1,2,3,4,5;
    6,7,8,9,1;
    1,1,1,1,1]
output =[1,2,3,4,5,8,1,1,1,1,1]

Unlike the previous problem 45399, this time the given matrix can be of any size.

Solution Stats

22.22% Correct | 77.78% Incorrect
Last Solution submitted on Jun 13, 2025

Problem Comments

Solution Comments

Show comments
Why should you share code?
In a discussion on LInkedin about my recent blog post, Do these...
2
3

Problem Recent Solvers12

Suggested Problems

More from this Author174

Community Treasure Hunt

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

Start Hunting!