Contradictions in ANY and ALL?
Mostrar comentarios más antiguos
Can someone please explain why MATLAB produces
any([]) = 0,
but we get
all([]) = 1 ?
This seems like a contradiction. The answer ought to be 1 for both.
Respuesta aceptada
Más respuestas (1)
James Tursa
el 8 de Jul. de 2015
Editada: James Tursa
el 8 de Jul. de 2015
0 votos
Only TMW can explain their reasoning, but this behavior is specifically documented for both functions. What doesn't seem to be documented is the behavior for other sized empty matrices/arrays.
Categorías
Más información sobre Functions 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!