different outcome cellfun(@isempty,..) vs cellfun('isempty',...)
Mostrar comentarios más antiguos
I have multiple tables stored in a cellarray. However some cells become empty [ ] after the removal of missing values.
My goal is to find out which cells become empty after this removal of ... .
I tried to do this with cellfun(@isempty,mycell) which does the job.
Further I tried to do this with cellfun('isempty',mycell) (according to what I've read this should be faster).
However the output is not the same (the last one returns a logical vector with all logical zero's).
I've checked the documentation but could not figure out why the outcomes differ.
Respuesta aceptada
Más respuestas (1)
Steven Lord
el 11 de Mzo. de 2021
1 voto
I recommend you avoid using the 'isempty' syntax in new code. It is present for backwards compatibility with (very) old code and its behavior does differ from the function handle syntax as stated in the description of the func input argument on the documentation page for the cellfun function.
Categorías
Más información sobre Data Type Identification 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!