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!