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!