ece210/hw4/antideriv.m

4 lines
86 B
Matlab

function int_Y_dx = antideriv(y, x)
int_Y_dx = ( cumtrapz(y) .* (x(2) - x(1)) );
end