How to replace values less than zero in a cell array with NaN?
9 次查看(过去 30 天)
显示 更早的评论
I have a huge cell array and there is a column with a lot of negative values. I want to clean up and replace all those values with NaN. Would appreciate any help. Thanks.
0 个评论
采纳的回答
Azzi Abdelmalek
2013-2-22
编辑:Azzi Abdelmalek
2013-2-22
% for all columns
B=cell2mat(A)
B(B<0)=nan
A=num2cell(B)
%if column 2 for e.g
B=cell2mat(A)
B(B(:,2)<0,2)=nan
A=num2cell(B)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!