Skip to content

Commit

Permalink
add naninterp.m
Browse files Browse the repository at this point in the history
  • Loading branch information
conundrumer committed Jan 5, 2016
1 parent 35f9d08 commit ed98f0b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions naninterp.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function X = naninterp(X)
% Interpolate over NaNs
X(isnan(X)) = interp1(find(~isnan(X)), X(~isnan(X)), find(isnan(X)), 'pchip');
return

0 comments on commit ed98f0b

Please # to comment.