Strange slope for points in a curve
Show older comments
Dear experts, I want to get the slope for each point from the curve defined below:
x = 1194:1206;
y =[114,115,117,118,119,120,122,123,124,126,127,128,129];
see the attached graph for the curve.
Directly applying the function "gradient" cannt get the correct slope - the slope will jump up an down. It's understandable that I don't have enough data points. I expect the slope changes gradually.
I expect not to use any interpretation or curve fitting method. Any suggestion is welcome. Many thanks
Accepted Answer
More Answers (1)
You cannot define a derivative without some sort of interpolation model. You can take first differences using diff(y), but that corresponds to a linear interpolation model.
Categories
Find more on Fit Postprocessing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!