ece210/hw4/feedback/deriv.m

5 lines
83 B
Matlab

function dy = deriv(y, x)
dy = diff(y) ./ (x(2) - x(1));
dy = dy([1 1:end]);
end