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

采纳的回答

Wayne King
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 个评论
Wayne King
Wayne King 2012-3-5
And you meant to type 'eq' (for equals) in your title, not 'eb'

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Structures 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by