How can I remove empty arrays of cell

2 ビュー (過去 30 日間)
Farshid Daryabor
Farshid Daryabor 2020 年 4 月 16 日
コメント済み: Stephen23 2020 年 4 月 16 日
please find attached file, how can I remove empty row of cell arrays. Thanks in advance,
  2 件のコメント
Stephen23
Stephen23 2020 年 4 月 16 日
編集済み: Stephen23 2020 年 4 月 16 日
"how can I remove empty row of cell arrays"
None of the cells are empty:
>> any(cellfun(@isempty,time))
ans = 0
All of the cells contain a scalar structure (which is inefficient storage: one non-scalar structure would be much better).
Farshid Daryabor
Farshid Daryabor 2020 年 4 月 16 日
I don't understand, what do you mean?
I want just remove '[]' arrays from 'time'

サインインしてコメントする。

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 4 月 16 日
Run this
idx = cellfun(@(x) isempty(x), time);
time(idx) = [];
  2 件のコメント
Farshid Daryabor
Farshid Daryabor 2020 年 4 月 16 日
Thanks, it's what I expected
Stephen23
Stephen23 2020 年 4 月 16 日
No need for an anonymous function:
idx = cellfun(@isempty, time);

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStructures についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by