Borrar filtros
Borrar filtros

error-undefined function 'eq'

2 visualizaciones (últimos 30 días)
FIR
FIR el 5 de Mzo. de 2012
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

Respuesta aceptada

Wayne King
Wayne King el 5 de Mzo. de 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 comentario
Wayne King
Wayne King el 5 de Mzo. de 2012
And you meant to type 'eq' (for equals) in your title, not 'eb'

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Structures en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by