identify rows with [] within a cell

2 visualizzazioni (ultimi 30 giorni)
Alberto Acri
Alberto Acri il 2 Dic 2023
Spostato: Dyuman Joshi il 2 Dic 2023
Hi! Is there any way to identify rows with [] within a cell? Something that is analogous to 'find'.
[rr,cc] = find(M(:,1) == []);

Risposta accettata

Dyuman Joshi
Dyuman Joshi il 2 Dic 2023
Spostato: Dyuman Joshi il 2 Dic 2023
You should use isempty for checking if an array (of any data type) is empty or not -
load('M.mat')
M
M = 6×1 cell array
{ 0×2 double} {36×2 double} {22×2 double} { 3×2 double} { 0×2 double} { 2×2 double}
cellfun('isempty', M)
ans = 6×1 logical array
1 0 0 0 1 0

Più risposte (0)

Prodotti


Release

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by