MATLAB: How to find the gradient of a curve at a specific point

gradient

Best Answer

If the data is in the variable "data", you find the gradient like this:
grad = zeros(size(data))
for i=1:(size(data,2)-1)
grad(i) = data(i+1)-data(i);
end