Replacing zeros with empty values?
42 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Sean de Wolski
2012-6-21
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
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!