Interpolation based on a condition with AND operator

조회 수: 1 (최근 30일)
Sam17
Sam17 2019년 4월 15일
댓글: KSSV 2019년 4월 16일
I am trying to interpolate using some condition. if the diff is less than 2 and diff_cor is less than 20 interpolate else fill with NaNs.
looks like it's not fulfulling my condition, Any suggestion here:
for iii=2:size(data_points)-2
if diff (iii)<2 && diff_cor(iii)<20
Data{:,col_num} = interp1(data_points,gamma_cor,new_interpolated_data,'linear');
else
Data{:,col_num}= NaN;
end
end
  댓글 수: 1
KSSV
KSSV 2019년 4월 16일
YOu first do interpolation with whol epoints...and later introduce NaN's at required indices.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by