Remove element from cell array completely

I have a cell array with the following information:
>> handles.guideGUI
ans =
Columns 1 through 8
@arq_02 @arq_03 @arq_04 @arq_05 @arq_06 @arq_07 @arq_08 @arq_09
Columns 9 through 14
@arq_10 @arq_11 @arq_12 @arq_13 @arq_14 []
It is still saying that that this is a 1x14 cell, and therefore the empty brackets [] still exist. How do I get rid of it completely so that it becomes 1x13 cell?
i.e. I want it to appear as:
ans =
Columns 1 through 8
@arq_02 @arq_03 @arq_04 @arq_05 @arq_06 @arq_07 @arq_08 @arq_09
Columns 9 through 13
@arq_10 @arq_11 @arq_12 @arq_13 @arq_14

 採用された回答

Thorsten
Thorsten 2014 年 12 月 18 日
編集済み: Thorsten 2014 年 12 月 18 日

2 投票

handles.guideGUI(15) = [];

4 件のコメント

Muaaman
Muaaman 2014 年 12 月 18 日
Unfortunately, that gives this:
>> handles.guideGUI{15} = []
handles =
guideGUI: {1x15 cell}
Which is:
>> handles.guideGUI
ans =
Columns 1 through 8
@arq_02 @arq_03 @arq_04 @arq_05 @arq_06 @arq_07 @arq_08 @arq_09
Columns 9 through 15
@arq_10 @arq_11 @arq_12 @arq_13 @arq_14 [] []
Thorsten
Thorsten 2014 年 12 月 18 日
Please look carefully at my answer: use (), not {}.
Muaaman
Muaaman 2014 年 12 月 19 日
Ohhh I see. My apologies Thorsten I see the difference. Thank you!
Stephen23
Stephen23 2014 年 12 月 19 日
It is very important to note the difference between () and {} indexing with cell arrays. In a nut-shell:
  • () refers to the cell itself, whereas
  • {} refers to the data within the cell.

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

その他の回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 12 月 18 日

1 投票

handles.guideGUI(cellfun('isempty',handles.guideGUI))=[]

1 件のコメント

Muaaman
Muaaman 2014 年 12 月 19 日
Thank you Azzi for this alternative answer.

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

カテゴリ

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

質問済み:

2014 年 12 月 18 日

コメント済み:

2014 年 12 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by