removing zeros

5 visualizaciones (últimos 30 días)
Trader
Trader el 6 de Abr. de 2012
short = cell and it contains mostly numbers:
[ 0]
[ 0]
[ 0]
[-673.12]
[ 0]
[ 0]
[ 0]
[ 0]
[ 0]
how do you clear zeros out of a cell array? when I try short(short == 0) = []; I get this error:
Undefined function 'eq' for input arguments of type 'cell'.

Respuestas (1)

Jan
Jan el 6 de Abr. de 2012
C = {0, -673.12, 0};
C = C(cellfun(@any, C));

Categorías

Más información sobre Multidimensional Arrays 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