Remove single values from a cell array containing 1x1 sub arrays

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

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 4 月 20 日
編集済み: Ameer Hamza 2020 年 4 月 20 日

0 投票

Try this
idx = cellfun(@isnumeric, x); % x is your cell array.
x(idx) = [];

2 件のコメント

han
han 2020 年 4 月 20 日
Thank you Ameer, this worked perfectly!
Ameer Hamza
Ameer Hamza 2020 年 4 月 20 日
Glad to be of help.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

質問済み:

han
2020 年 4 月 20 日

コメント済み:

2020 年 4 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by