find structure

I have 2 structure vectors A and B. I want to find the files in A that are not in B I used x=find(~ismember(A,B)); I received an error : ??? Error using ==> double Conversion to double from struct is not possible.
Error in ==> ismember at 90 a = double(a);
How can I perform this task?

3 comentarios

Fangjun Jiang
Fangjun Jiang el 20 de Sept. de 2011
What is your structure A and B? Does it come from dir()?
per isakson
per isakson el 20 de Sept. de 2011
Do you mean "fields" rather than "files"? If so try setdiff( fieldnames(A),fieldnames(B) )
joseph Frank
joseph Frank el 21 de Sept. de 2011
A and B come from dir( )
A = dir('ret*.mat');

Iniciar sesión para comentar.

Respuestas (1)

Fangjun Jiang
Fangjun Jiang el 2 de Oct. de 2011

1 voto

setdiff({A.name},{B.name})

Categorías

Etiquetas

Preguntada:

el 20 de Sept. de 2011

Community Treasure Hunt

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

Start Hunting!

Translated by