I want to extract half of the non-zero element of a matrix

Hello, I have a matrix of the following form: [1,0,0,0;0,0,0,0;0,10,0,12;13,0,0,0], I need a mask that allows me to extract half of the data of each nonzero matrix of this form in this case for example I want the following result [1,0,0,0;0,0,0,0;0,10,0,0;0,0,0,0]

Categories

Asked:

on 14 Oct 2012

Community Treasure Hunt

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

Start Hunting!