Replacing zeros with empty values?

Is it possible for matrices in matlab to replace zeros by empty values i.e. not even give a zero but have blank entries?

 Respuesta aceptada

Sean de Wolski
Sean de Wolski el 21 de Jun. de 2012
No. Not unless every row/column has one and you concatenate.
It is possible to have empty elements in cell arrays though, consider:
A = magic(5); %sample
A(A<10)=0; %some zeros
C = cellfun(@(x)x(logical(x)),num2cell(A),'uni',false) %cell with empties where zeros were

1 comentario

Mark
Mark el 21 de Jun. de 2012
Excellent, I didn't think so, and you're alternative is fantastic! Thank you!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Data Type Identification en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 21 de Jun. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by