Deleting rows of an array
Ältere Kommentare anzeigen
Hi all,
I have an array 48X365, where some of the columns are zero!
Is there any way to delete them and get an array without these columns?
The thing is that the columns appear randomly
thanks!
Akzeptierte Antwort
Weitere Antworten (1)
KSSV
am 4 Apr. 2017
Let data be your matrix where few columns are zeroes. Use:
data(:, sum(data,1)==0) = [] ; % removes columns with zeroes
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!