How to find arrays in a cell array
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Efstathios Kontolatis
il 16 Gen 2017
Modificato: Stephen23
il 16 Gen 2017
Hi guys,
I have a cell array(let's say c) consisting of 2D arrays and I want to find all the arrays that(say a is an array) have size(a,1)<5 and throw them away of the cell. How can I do that?
Thanks in advance
0 Commenti
Risposta accettata
James Tursa
il 16 Gen 2017
Modificato: James Tursa
il 16 Gen 2017
c = your cell array
x = cellfun(@(x)size(x,1)<5,c); % Logical indexes of arrays with 1st dim < 5
c(x) = []; % Delete those elements from the cell array
Vedere anche
Categorie
Scopri di più su Matrices and Arrays in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!