Remove single values from a cell array containing 1x1 sub arrays
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hello everyone,
I have the below cell array containing 1705 values, containing a mixture of single values and sub cell arrays as shown in the photo.
The 1x1 arrays contain different sized vectors.
I was wondering if anyone knew how to remove the single values eg 550, 101, 292 etc please? Either delete them completely or move them to a new array.
My thinking is that if i remove the single values, then i can use sub2mat for the 1x1 ones.
Thank you very much

0 Commenti
Risposta accettata
Ameer Hamza
il 20 Apr 2020
Modificato: Ameer Hamza
il 20 Apr 2020
Try this
idx = cellfun(@isnumeric, x); % x is your cell array.
x(idx) = [];
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Matrix Indexing 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!