This commit is contained in:
xinxiao
2026-03-13 11:24:41 +08:00
commit 04e2bb29c7
238 changed files with 29102 additions and 0 deletions
@@ -0,0 +1,13 @@
function h = dinterptable(X, Y, u)
% n = length(X);
% DYDX = diff(Y) ./ diff(X);
% DYDX = DYDX([1, 1:end, end]);
% [~, b] = histc(u, [-inf;X;inf]);
% b = b - 1;
% b(b == 0) = 1;
% b(b == n) = n - 1;
% h = DYDX(b);
DYDX = diff(Y) ./ diff(X);
DYDX = DYDX([1, 1:end, end]);
[~, b] = histc(u, [-inf;X;inf]);
h = reshape(DYDX(b), [], 1);