Replacing zeros with empty values?
49 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Is it possible for matrices in matlab to replace zeros by empty values i.e. not even give a zero but have blank entries?
0 commentaires
Réponse acceptée
Sean de Wolski
le 21 Juin 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
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!