function [y_inf, x_inf] = inflections(y, x) y_switch = switchsign( deriv(deriv(y, x), x) ); y_inf = nonzeros(y_switch .* y); x_inf = nonzeros(y_switch .* x); end