getting cell contents reference from non cell object error for following code
1 次查看(过去 30 天)
显示 更早的评论
if (length(A) < sArea || length(B) < sArea) || ncut > sNcut
Seg{1} = Seg{i}; %#ok<NASGU>
Id{1} = id; %#ok<NASGU> % for debugging
Ncut{1} = ncut; %#ok<NASGU> % for duebugging
return;
end
getting error
??? Cell contents reference from a non-cell array object.
What is the solution
Error in ==> Nc at 74 Seg{1} = Seg{i}; %#ok<NASGU>
2 个评论
回答(1 个)
Image Analyst
2014-1-15
Seg is just a regular numerical array, NOT a cell array. You created it like this:
Seg = (1:N)';
So you need to refer to it like this Seg(index), NOT like this Seg{index}. Braces are used for cells while parentheses are used for arrays. Please see the FAQ on cells: http://matlab.wikia.com/wiki/FAQ#What_is_a_cell_array.3F
2 个评论
Image Analyst
2014-1-15
You redefined size(), didn't you? What does this say
>> which -all size
or just before that line of code, put this
whos size
You have a size variable or function that it's using that is not the built-in size() function.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!