Remove all the columns contains only zero - MATLAB Cody - MATLAB Central

Problem 43565. Remove all the columns contains only zero

Difficulty:Rate

Remove the column from the matrix which has only zeros . Refer the Example below

a= 1   0  3  0
   23  0  56 0
   1   0  9  0
output=1  3
       23 56
       1  9

Solution Stats

53.08% Correct | 46.92% Incorrect
Last Solution submitted on Jul 01, 2025

Problem Comments

Solution Comments

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

Problem Recent Solvers222

Suggested Problems

More from this Author1

Community Treasure Hunt

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

Start Hunting!