error-undefined function 'eq'
2 次查看(过去 30 天)
显示 更早的评论
if any(A==B)
message = sprintf('The B value of %d is in A.', B);
uiwait(msgbox(message));
end
i get error as
Undefined function or method 'eq' for input arguments of type 'struct'.
Error in ==> main_final at 100
if any(A==B)
A=load('Video_database.dat','-mat');
i A i have 3 values ,in B 2 values
please help
0 个评论
采纳的回答
Wayne King
2012-3-5
You can't use this kind of comparison on structure arrays.
It sounds like you can use ismember() but you have to make the comparison outside of a structure array.
For example:
A = 1:3;
B = 2;
if any(ismember(A,B))
disp('True');
else
disp('False');
end
I realize you are trying to also capture the similar values, (not the simple thing I have done), but the main problem you are facing is trying to make the comparison directly on structure arrays.
1 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!