identify rows with [] within a cell

1 回表示 (過去 30 日間)
Alberto Acri
Alberto Acri 2023 年 12 月 2 日
移動済み: Dyuman Joshi 2023 年 12 月 2 日
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 Center および File ExchangeLogical についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by