I have a matrix whose size is 4x16
and I need to remove all columns which have the value of first row is zero. For example: here is the matrix example :
X = [1 0 0 0; 0 1 0 0; 0 0.4 0 0; 0 0 0 0.8; 0.5 0 0 0];
The 2D matrix (X) looks like this:
1 0 0 0
0 1 0 0
0 0.4 0 0
0 0 0 0.8
0.5 0 0 0
So what I need is just X = [1 0 0 0;0.5 0 0 0 ]
because the first row of these columns are different of Zero.