Q:

How to find minimum of each curvature point?

I'm using Polynomial curve fitting to analyze my data (polyfit and polyval) and i got the curve like this. I want to find the minimum point of each curve (red dot). If i use min() i will get the point only one curve. How to get both point? 

Thnak you so much 

A:

Simple: 
% Your polynomial coefficients
c = [-1 4 5 2 6 2 4 5];

% Find real roots of its derivative
R = roots( [numel(c)-1 : -1 : 1] .* c(1:end-1) );
R = R(imag(R)==0);

% Compute and sort function values of these extrema
if ~isempty(R)

    [yExtrema, indsExtrema] = sort(polyval(c, R));
    xExtrema = R(indsExtrema);

    % Extract the two smallest ones
    yMins = yExtrema(1:2);
    xMins = xExtrema(1:2);

else
    yMins = [];
    xMins = [];

end

