Undefined function 'eq' for input arguments of type 'cell'.
조회 수: 13 (최근 30일)
이전 댓글 표시
Hi! I don't understand because my code gives an error
if (prefixTree(1,4).prefixTree2(:,2)=='2')
unique(prefixTree(1,4).prefixTree2(:,3))
end
Error:
Undefined function 'eq' for input arguments of type 'cell'.
Thanks
댓글 수: 0
채택된 답변
Stephen23
2016년 1월 12일
편집: Stephen23
2016년 1월 12일
Relational operators can be used with numeric arrays or character arrays. It makes no sense to use them with cell arrays. Consider the following:
>> {3}==3 % cell array
Undefined function 'eq' for input arguments of type 'cell'.
>> 3==3 % numeric array
ans =
1
>> strcmp('3','3')
ans =
1
>> strcmp({'3'},'3')
ans =
1
Here some of the other questions asked by people trying to perform numeric operations on cell arrays (which is always an error, as numeric operations can only be performed on numeric arrays):
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Cell Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!