How to get_ride of NaN values in a cell?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi everyone,
I have two dataset and need to scareen second set for each value fo the first set using its upper and lower bound. Either there be some value in teh upper and lower bound or zero. But, the output include NaN values as a count (Earlier, I post this question, but still unable to fix this).
Data and script as follows:
clear all
clc
data1=readmatrix('data1.csv'); % selected candidate earthquake
ev_time=datenum(data1(:,1),data1(:,2),data1(:,3),data1(:,4),data1(:,5),data1(:,6));
cand_ev=ev_time';
for jj=1:194
b=cand_ev(:,jj);
aa(jj)= addtodate(b, 30, 'day');
bb(jj)= addtodate(b, -30, 'day');
end
U_lim=aa;
L_lim=bb;
a=load('selected_0.01.csv');
for kk=1:194
for ii=1:10
e{ii, kk}=a(a(:, ii)>L_lim(:,kk) & a(:,ii)<U_lim(:, kk));
end
end
%ee=e>0;
count = cellfun(@numel, e);
nc = sum(count>=10);
댓글 수: 0
채택된 답변
Bruno Luong
2022년 4월 14일
IMH this is correct statement inside the double for-loop
e{ii, kk}=a(a(:, ii)>L_lim(:,kk) & a(:,ii)<U_lim(:, kk), ii);
추가 답변 (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!