필터 지우기
필터 지우기

Remove element from cell array completely

조회 수: 2 (최근 30일)
Muaaman
Muaaman 2014년 12월 18일
댓글: Stephen23 2014년 12월 19일
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일
handles.guideGUI(15) = [];
  댓글 수: 4
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일
handles.guideGUI(cellfun('isempty',handles.guideGUI))=[]
  댓글 수: 1
Muaaman
Muaaman 2014년 12월 19일
Thank you Azzi for this alternative answer.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by