現在この提出コンテンツをフォロー中です。
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます
One-line logically-indexed call to matlab function "interp1"
Fill nan-holes, fast and easy.
>> x = [1 2 NaN NaN 5 6];
>> naninterp(x)
ans =
1 2 3 4 5 6
Cubic interpolation by default, you should know how to change that :-)
--------------------------------------------------------------------------
function X = naninterp(X)
% Interpolate over NaNs
X(isnan(X)) = interp1(find(~isnan(X)), X(~isnan(X)), find(isnan(X)), 'cubic');
return
--------------------------------------------------------------------------
引用
E. Rodriguez (2026). naninterp (https://jp.mathworks.com/matlabcentral/fileexchange/8225-naninterp), MATLAB Central File Exchange. に取得済み.
謝辞
ヒントを与えたファイル: interp1gap, repnan
| バージョン | 公開済み | リリース ノート | Action |
|---|---|---|---|
| 1.0.0.0 | added keywords |
