Skip to content

Commit

Permalink
tsInterp1Extrap.m: offsetting by default negative values, for which i…
Browse files Browse the repository at this point in the history
…t is impossible to compute logarithm
  • Loading branch information
Lorenzo Mentaschi committed Aug 30, 2018
1 parent eff6bf5 commit 612f06a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tsInterp1Extrap.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@

end

minX = min(min(Xq(:)), min(X(:)));
if minX < 1
xoffset = -minX + 1;
else
xoffset = 0;
end

X = X + xoffset;
Xq = Xq + xoffset;

% sort x independent variable
[X,ii]=sort(X);

Expand Down Expand Up @@ -78,4 +88,4 @@

end

end
end

0 comments on commit 612f06a

Please sign in to comment.