error-undefined function 'eq'
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
Wayne King
am 5 Mär. 2012
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 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Structures finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!