フィルターのクリア

Undefined function 'eq' for input arguments of type 'cell'.

9 ビュー (過去 30 日間)
cat cat
cat cat 2016 年 1 月 12 日
編集済み: Stephen23 2016 年 1 月 12 日
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

採用された回答

Stephen23
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
if you wish to test for a particular string, use strcmp:
>> 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 件)

カテゴリ

Help Center および File ExchangeData Types についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by