Take the 2-minute tour ×  I want to make a condition that check
if the cell array is empty then move to the next.  I got this
index exceed matrix dimensions  Looking forward to hear from you
share|improve this question  1 Answer 1  You can use isempty to
check if an element is empty or not:  C = cell(5,1); C{2} = 2;
for ind = 1:length(C)     if ~isempty(C{ind})
disp(['Processing C{' num2str(ind) '}']);  and never let index
of C exceed length(C).  share|improve this answer Thank you for
the reply, I have applied almost similar to what you suggested
but It is not working in the way I want it to work.. It trigger
an error.. Index exceeds matrix dimensions. Error in Senses
(line 48) senses = regexp(groupSenses{1}, [arrowSymbol '[\w,
]*\n '], 'match'); –  user2040072 Jun 15 '13 at 18:13 Can you
confirm that length(groupSenses) is greater than 1? –  pm89 Jun
15 '13 at 21:45 The groupSense is 1x0 cell... It is an empty
cell –  user2040072 Jun 15 '13 at 23:18 So groupSenses{1} does
not exist. You are trying