Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Issues with the for loop
조회 수: 1 (최근 30일)
이전 댓글 표시
tt=0;
for i = 1:size(ids_2006,2) * size od ids_2006 is 212*119*177
for j = 1:size(ids_2006,3)
tt=tt+1;
i,j,tt
% size of mean_wint_rho is 119*177
% size of stdv_daily_2006 is 119*177
if (squeeze(ids_2006(tt,:,:)) < (mean_wint_rho(:,:) - 3*stdv_daily_2006(:,:)))
daily_2006 = squeeze(ids_2006(:,i,j));
new_daily_2006(tt,:,:) = daily_2006;
%size of new_daily_2006 should be 212*119*177
else
new_daily_2006(tt,:,:) = NaN;
end
end
end
I want to remove the bias from the daily dataset by removing the points that are three standard deviation from the mean.
댓글 수: 0
답변 (1개)
darova
2019년 8월 15일
This should work
new_daily_2006 = ids_2006*0;
for i = 1:size(ids_2006,1) %* size od ids_2006 is 212*119*177
% i,j,tt
% size of mean_wint_rho is 119*177
% size of stdv_daily_2006 is 119*177
if (squeeze(ids_2006(i,:,:)) < (mean_wint_rho(:,:) - 3*stdv_daily_2006(:,:)))
new_daily_2006(i,:,:) = squeeze(ids_2006(i,:,:));
%size of new_daily_2006 should be 212*119*177
else
new_daily_2006(i,:,:) = NaN;
end
end
The question is: when it will be work?
if (squeeze(ids_2006(i,:,:)) < (mean_wint_rho(:,:) - 3*stdv_daily_2006(:,:)))
Something like this
if ([1 0])
disp('hi')
end
Or maybe this
if any([1 0])
disp('hi')
end
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!