identify rows with [] within a cell

2 次查看(过去 30 天)
Hi! Is there any way to identify rows with [] within a cell? Something that is analogous to 'find'.
[rr,cc] = find(M(:,1) == []);

采纳的回答

Dyuman Joshi
Dyuman Joshi 2023-12-2
移动:Dyuman Joshi 2023-12-2
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by