??? Undefined function or method 'isnan' for input arguments of type 'struct'.
Mostrar comentarios más antiguos
I have a structure array, 'AMap'. The elements of 'AMap', which are called 'fitresults', are most often structre arrays themselves, but sometimes they are supposed to be equal to NaN, such as can be seen and verified in the command window:
>> AMap(8,1).fitresults
ans =
NaN
>> isnan(AMap(8,1).fitresults)
ans =
1
But when I try to use 'isnan' in an if statement in a forloop in a function,
if(isnan(AMap(i,j).fitresults)==0)
I get the error:
??? Undefined function or method 'isnan' for input arguments of type 'struct'.
but as you can see 'isnan' must be defined for structs since I can use isnan on a struct in the command window. What gives? How can I get around this?
thanks in advance,
Rory
Respuesta aceptada
Más respuestas (1)
Rory Staunton
el 11 de Mayo de 2011
0 votos
Categorías
Más información sobre Structures en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!