フィルターのクリア

Interpolating if consecutive NaNs less than 16

1 回表示 (過去 30 日間)
MF
MF 2016 年 9 月 11 日
編集済み: Walter Roberson 2016 年 9 月 11 日
I am trying to interpolate only gaps less than 16..but I can't manage..till now I only managed to interpolate all the gaps...any help please?
for x = 1:1:size(InterpSST, 1)
for y = 1:1:size(InterpSST, 2)
disp(['Processing: ', num2str(x), ', ', num2str(y)]);
tempCnt = squeeze(superFullTime);
temp = squeeze(InterpSST(x, y, :));
zero_idxptData = find(temp <= 14);
temp(zero_idxptData) = []; %remove the nan
tempCnt(zero_idxptData) = []; %remove the corrisponding time
tempFull = interp1(tempCnt(:), temp(:), superFullTime(:), 'spline'); %interpolate the removed time & sst values from superFullTime
InterpSST(x, y, :) = tempFull;
end
end

回答 (1 件)

Chad Greene
Chad Greene 2016 年 9 月 11 日
Try using interp1gap.

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by