how can i find convex and concave points
Show older comments
how do I find the convex and concave points of the discrete data as in the photo

Accepted Answer
More Answers (1)
Steven Lord
on 15 May 2019
Depending on what you want to do with this information (which is not clear from the question) you may find the ischange function useful.
f = @(x) 1-(x./sqrt(1+x.^2)); % Create Function
x = linspace(-10, 10);
y = f(x);
changes = ischange(y, 'linear', 'SamplePoints', x);
plot(x, y, '-', x(changes), y(changes), 'gp')
grid on
axis('equal')
xlim([-2.5 2.5])
2 Comments
Cem SARIKAYA
on 15 May 2019
Adam Danz
on 15 May 2019
@Cem SARIKAYA, Steven Lord's proposal is similar to Star Strider's. In the function ischange(), when the method is set to 'linear', the slope of the line is considered and it searches for abrupt changes in the slope.
Again, take a moment to grasp these concepts conceptually before you worry about implementing the code.
Categories
Find more on Data Distribution Plots 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!

