Could anyone help me to solve the error undefined operator
2 次查看(过去 30 天)
显示 更早的评论
Undefined operator '==' for input arguments of type 'cell'.
Error in five (line 32)
acc = sum(YPred == YTest)./numel(YTest);
0 个评论
回答(1 个)
Jonas
2021-6-20
编辑:Jonas
2021-6-20
YPred and/or YTest are cells which can contain any kind of data, also tables, graphical objects. for that reason there is no operator for the cell. it you want to compare the content of the cell and it contains e.g. a matrix, you can use cell2mat on your variables in the formular or use suitable brackets (e.g. YPred{:} )
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!